mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-29 10:09:08 +02:00
pool: replace defer cleanup with t.Cleanup
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
@ -71,7 +71,9 @@ func testWorkerPool(t *testing.T, test workerPoolTest) {
|
|||||||
|
|
||||||
p := test.newPool()
|
p := test.newPool()
|
||||||
startGeneric(t, p)
|
startGeneric(t, p)
|
||||||
defer stopGeneric(t, p)
|
t.Cleanup(func() {
|
||||||
|
stopGeneric(t, p)
|
||||||
|
})
|
||||||
|
|
||||||
submitNonblockingGeneric(t, p, test.numWorkers)
|
submitNonblockingGeneric(t, p, test.numWorkers)
|
||||||
})
|
})
|
||||||
@ -81,7 +83,9 @@ func testWorkerPool(t *testing.T, test workerPoolTest) {
|
|||||||
|
|
||||||
p := test.newPool()
|
p := test.newPool()
|
||||||
startGeneric(t, p)
|
startGeneric(t, p)
|
||||||
defer stopGeneric(t, p)
|
t.Cleanup(func() {
|
||||||
|
stopGeneric(t, p)
|
||||||
|
})
|
||||||
|
|
||||||
submitBlockingGeneric(t, p, test.numWorkers)
|
submitBlockingGeneric(t, p, test.numWorkers)
|
||||||
})
|
})
|
||||||
@ -91,7 +95,9 @@ func testWorkerPool(t *testing.T, test workerPoolTest) {
|
|||||||
|
|
||||||
p := test.newPool()
|
p := test.newPool()
|
||||||
startGeneric(t, p)
|
startGeneric(t, p)
|
||||||
defer stopGeneric(t, p)
|
t.Cleanup(func() {
|
||||||
|
stopGeneric(t, p)
|
||||||
|
})
|
||||||
|
|
||||||
submitPartialBlockingGeneric(t, p, test.numWorkers)
|
submitPartialBlockingGeneric(t, p, test.numWorkers)
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user