Skip to content

Commit 486d12e

Browse files
committed
call cleanup func position change
1 parent bee1963 commit 486d12e

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

test/integration/scheduler_perf/scheduler_perf.go

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,6 +1426,9 @@ func startCollectingMetrics(tCtx ktesting.TContext, collectorWG *sync.WaitGroup,
14261426
if err != nil {
14271427
return nil, nil, fmt.Errorf("op %d: Failed to initialize data collector: %v", opIndex, err)
14281428
}
1429+
tCtx.TB().Cleanup(func() {
1430+
collectorCtx.Cancel("cleaning up")
1431+
})
14291432
collectorWG.Add(1)
14301433
go func() {
14311434
defer collectorWG.Done()
@@ -1663,11 +1666,6 @@ func (e *WorkloadExecutor) runCreatePodsOp(opIndex int, op *createPodsOp) error
16631666
if err != nil {
16641667
return err
16651668
}
1666-
e.tCtx.TB().Cleanup(func() {
1667-
if e.collectorCtx != nil {
1668-
e.collectorCtx.Cancel("cleaning up")
1669-
}
1670-
})
16711669
}
16721670
if err := createPodsRapidly(e.tCtx, namespace, op); err != nil {
16731671
return fmt.Errorf("op %d: %v", opIndex, err)
@@ -1879,11 +1877,6 @@ func (e *WorkloadExecutor) runStartCollectingMetricsOp(opIndex int, op *startCol
18791877
if err != nil {
18801878
return err
18811879
}
1882-
e.tCtx.TB().Cleanup(func() {
1883-
if e.collectorCtx != nil {
1884-
e.collectorCtx.Cancel("cleaning up")
1885-
}
1886-
})
18871880
return nil
18881881
}
18891882

0 commit comments

Comments
 (0)