make tests pass with "go test -count n" with n > 1

by closing initialized resources during tests.
This commit is contained in:
Mechiel Lukkien
2024-06-10 18:18:20 +02:00
parent dde2258f69
commit f56b04805b
9 changed files with 50 additions and 40 deletions

View File

@ -314,6 +314,7 @@ func TestAPI(t *testing.T) {
queue.Localserve = true // Deliver directly to us instead attempting actual delivery.
err = queue.Init()
tcheck(t, err, "queue init")
defer queue.Shutdown()
api.MessageSubmit(ctx, SubmitMessage{
From: "mjl@mox.example",
To: []string{"mjl+to@mox.example", "mjl to2 <mjl+to2@mox.example>"},