queue: replace defer cleanup with t.Cleanup

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
Eng Zer Jun
2022-08-27 15:07:23 +08:00
parent 5e6690107e
commit 7070be52b7

View File

@@ -14,7 +14,7 @@ func testQueueAddDrain(t *testing.T, size, numStart, numStop, numAdd, numDrain i
queue.Start()
}
for i := 0; i < numStop; i++ {
defer queue.Stop()
t.Cleanup(queue.Stop)
}
// Pushes should never block for long.