More consistent interrupts.

This commit is contained in:
Nuno Cruces
2024-10-08 16:38:57 +01:00
parent cc7bacfb9c
commit e524fb185d
3 changed files with 7 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ import (
"path/filepath"
"strings"
"testing"
"time"
"github.com/ncruces/go-sqlite3"
_ "github.com/ncruces/go-sqlite3/embed"
@@ -148,7 +149,10 @@ func TestConn_SetInterrupt(t *testing.T) {
defer stmt.Close()
db.SetInterrupt(ctx)
go cancel()
go func() {
time.Sleep(time.Millisecond)
cancel()
}()
// Interrupting works.
err = stmt.Exec()