mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 23:37:01 +00:00
call cleanup func position change
This commit is contained in:
parent
bee19638f1
commit
486d12efc5
@ -1426,6 +1426,9 @@ func startCollectingMetrics(tCtx ktesting.TContext, collectorWG *sync.WaitGroup,
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, fmt.Errorf("op %d: Failed to initialize data collector: %v", opIndex, err)
|
return nil, nil, fmt.Errorf("op %d: Failed to initialize data collector: %v", opIndex, err)
|
||||||
}
|
}
|
||||||
|
tCtx.TB().Cleanup(func() {
|
||||||
|
collectorCtx.Cancel("cleaning up")
|
||||||
|
})
|
||||||
collectorWG.Add(1)
|
collectorWG.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
defer collectorWG.Done()
|
defer collectorWG.Done()
|
||||||
@ -1663,11 +1666,6 @@ func (e *WorkloadExecutor) runCreatePodsOp(opIndex int, op *createPodsOp) error
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
e.tCtx.TB().Cleanup(func() {
|
|
||||||
if e.collectorCtx != nil {
|
|
||||||
e.collectorCtx.Cancel("cleaning up")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
if err := createPodsRapidly(e.tCtx, namespace, op); err != nil {
|
if err := createPodsRapidly(e.tCtx, namespace, op); err != nil {
|
||||||
return fmt.Errorf("op %d: %v", opIndex, err)
|
return fmt.Errorf("op %d: %v", opIndex, err)
|
||||||
@ -1879,11 +1877,6 @@ func (e *WorkloadExecutor) runStartCollectingMetricsOp(opIndex int, op *startCol
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
e.tCtx.TB().Cleanup(func() {
|
|
||||||
if e.collectorCtx != nil {
|
|
||||||
e.collectorCtx.Cancel("cleaning up")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user