mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
use Cleanup instead of defer
This commit is contained in:
parent
41577dea1b
commit
8e4b00e949
@ -1515,9 +1515,11 @@ func runWorkload(tCtx ktesting.TContext, tc *testCase, w *workload, informerFact
|
|||||||
workload: w,
|
workload: w,
|
||||||
}
|
}
|
||||||
|
|
||||||
defer executor.wg.Wait()
|
tCtx.TB().Cleanup(func() {
|
||||||
defer executor.collectorWG.Wait()
|
tCtx.Cancel("workload is done")
|
||||||
defer tCtx.Cancel("workload is done")
|
executor.collectorWG.Wait()
|
||||||
|
executor.wg.Wait()
|
||||||
|
})
|
||||||
|
|
||||||
for opIndex, op := range unrollWorkloadTemplate(tCtx, tc.WorkloadTemplate, w) {
|
for opIndex, op := range unrollWorkloadTemplate(tCtx, tc.WorkloadTemplate, w) {
|
||||||
realOp, err := op.realOp.patchParams(w)
|
realOp, err := op.realOp.patchParams(w)
|
||||||
|
Loading…
Reference in New Issue
Block a user