mirror of
https://github.com/mjl-/mox.git
synced 2025-07-10 07:14:40 +03:00
make tests pass with "go test -count n" with n > 1
by closing initialized resources during tests.
This commit is contained in:
@ -48,6 +48,7 @@ func TestCtl(t *testing.T) {
|
||||
|
||||
err := queue.Init()
|
||||
tcheck(t, err, "queue init")
|
||||
defer queue.Shutdown()
|
||||
|
||||
testctl := func(fn func(clientctl *ctl)) {
|
||||
t.Helper()
|
||||
@ -426,10 +427,13 @@ func TestCtl(t *testing.T) {
|
||||
// "backup", backup account.
|
||||
err = dmarcdb.Init()
|
||||
tcheck(t, err, "dmarcdb init")
|
||||
defer dmarcdb.Close()
|
||||
err = mtastsdb.Init(false)
|
||||
tcheck(t, err, "mtastsdb init")
|
||||
defer mtastsdb.Close()
|
||||
err = tlsrptdb.Init()
|
||||
tcheck(t, err, "tlsrptdb init")
|
||||
defer tlsrptdb.Close()
|
||||
testctl(func(ctl *ctl) {
|
||||
os.RemoveAll("testdata/ctl/data/tmp/backup-data")
|
||||
err := os.WriteFile("testdata/ctl/data/receivedid.key", make([]byte, 16), 0600)
|
||||
|
Reference in New Issue
Block a user