diff options
Diffstat (limited to 'tests/functional')
-rw-r--r-- | tests/functional/consumer-with-deadletter/q.go | 6 | ||||
-rw-r--r-- | tests/functional/new-instance-takeover/q.go | 20 | ||||
-rw-r--r-- | tests/functional/wait-after-publish/q.go | 5 |
3 files changed, 3 insertions, 28 deletions
diff --git a/tests/functional/consumer-with-deadletter/q.go b/tests/functional/consumer-with-deadletter/q.go index 25391c5..a79ad5b 100644 --- a/tests/functional/consumer-with-deadletter/q.go +++ b/tests/functional/consumer-with-deadletter/q.go @@ -2,7 +2,6 @@ package q import ( "errors" - "os" "runtime" "guuid" @@ -44,15 +43,10 @@ func MainTest() { g.TAssertEqualS(ok, true, "can't get filename") databasePath := file + ".db" - os.Remove(databasePath) - os.Remove(databasePath + "-shm") - os.Remove(databasePath + "-wal") - queue, err := New(databasePath) g.TErrorIf(err) defer queue.Close() - pub := func(payload []byte, flowID guuid.UUID) { unsent := UnsentMessage{ Topic: topicX, diff --git a/tests/functional/new-instance-takeover/q.go b/tests/functional/new-instance-takeover/q.go index 6e04e5f..76ed59f 100644 --- a/tests/functional/new-instance-takeover/q.go +++ b/tests/functional/new-instance-takeover/q.go @@ -1,7 +1,6 @@ package q import ( - "fmt" "runtime" "os" @@ -33,16 +32,16 @@ func handlerFn(publish func(guuid.UUID)) func(Message) error { } func startInstance( - databasePath string, + dbpath string, instanceID int, name string, ) (IQueue, error) { - iqueue, err := New(databasePath) + iqueue, err := New(dbpath) g.TErrorIf(err) queue := iqueue.(queueT) notifyFn := makeNotifyFn(queue.subscriptions.read, queue.pinger) - queries, err := initDB(queue.db, defaultPrefix, notifyFn, instanceID) + queries, err := initDB(dbpath, defaultPrefix, notifyFn, instanceID) g.TErrorIf(err) err = queue.queries.close() @@ -68,20 +67,12 @@ func startInstance( func MainTest() { - // https://sqlite.org/forum/forumpost/2507664507 g.Init() _, file, _, ok := runtime.Caller(0) g.TAssertEqualS(ok, true, "can't get filename") dbpath := file + ".db" - dbpath = "/mnt/dois/andreh/t.db" - os.Remove(dbpath) - os.Remove(dbpath + "-shm") - os.Remove(dbpath + "-wal") - - // FIXME - return instanceID1 := os.Getpid() instanceID2 := instanceID1 + 1 @@ -89,10 +80,6 @@ func MainTest() { flowID2 := guuid.New() g.Testing("new instances take ownership of topic+name combo", func() { - if false { - fmt.Fprintf(os.Stderr, "(PID %d + 1) ", instanceID1) - } - q1, err := startInstance(dbpath, instanceID1, "first") g.TErrorIf(err) defer q1.Close() @@ -103,7 +90,6 @@ func MainTest() { <- q1.WaitFor("individual-first", flowID1, "w").Channel <- q1.WaitFor( "shared-first", flowID1, "w").Channel - // println("waited 1") q2, err := startInstance(dbpath, instanceID2, "second") g.TErrorIf(err) diff --git a/tests/functional/wait-after-publish/q.go b/tests/functional/wait-after-publish/q.go index 15a532d..b70d27e 100644 --- a/tests/functional/wait-after-publish/q.go +++ b/tests/functional/wait-after-publish/q.go @@ -1,7 +1,6 @@ package q import ( - "os" "runtime" "guuid" @@ -19,10 +18,6 @@ func MainTest() { g.TAssertEqualS(ok, true, "can't get filename") databasePath := file + ".db" - os.Remove(databasePath) - os.Remove(databasePath + "-shm") - os.Remove(databasePath + "-wal") - queue, err := New(databasePath) g.TErrorIf(err) defer queue.Close() |