From 7070be52b7f20ddde35570168c6bb48f6a5ebac9 Mon Sep 17 00:00:00 2001 From: Eng Zer Jun Date: Sat, 27 Aug 2022 15:07:23 +0800 Subject: [PATCH] queue: replace defer cleanup with `t.Cleanup` Signed-off-by: Eng Zer Jun --- queue/queue_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/queue/queue_test.go b/queue/queue_test.go index bd74dcc02..35f007cd5 100644 --- a/queue/queue_test.go +++ b/queue/queue_test.go @@ -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.