Skip to content

Commit 8e4b00e

Browse files
committed
use Cleanup instead of defer
1 parent 41577de commit 8e4b00e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/integration/scheduler_perf/scheduler_perf.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,9 +1515,11 @@ func runWorkload(tCtx ktesting.TContext, tc *testCase, w *workload, informerFact
15151515
workload: w,
15161516
}
15171517

1518-
defer executor.wg.Wait()
1519-
defer executor.collectorWG.Wait()
1520-
defer tCtx.Cancel("workload is done")
1518+
tCtx.TB().Cleanup(func() {
1519+
tCtx.Cancel("workload is done")
1520+
executor.collectorWG.Wait()
1521+
executor.wg.Wait()
1522+
})
15211523

15221524
for opIndex, op := range unrollWorkloadTemplate(tCtx, tc.WorkloadTemplate, w) {
15231525
realOp, err := op.realOp.patchParams(w)

0 commit comments

Comments
 (0)