mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-08 03:33:56 +00:00
separete sleep func
This commit is contained in:
parent
6d291ddc21
commit
ca8a0f5f1b
@ -1553,10 +1553,7 @@ func runWorkload(tCtx ktesting.TContext, tc *testCase, w *workload, informerFact
|
||||
case *barrierOp:
|
||||
executor.runBarrierOp(opIndex, concreteOp)
|
||||
case *sleepOp:
|
||||
select {
|
||||
case <-tCtx.Done():
|
||||
case <-time.After(concreteOp.Duration.Duration):
|
||||
}
|
||||
executor.runSleepOp(concreteOp)
|
||||
case *startCollectingMetricsOp:
|
||||
executor.runStartCollectingMetricsOp(opIndex, concreteOp)
|
||||
defer (*executor.collectorCtx).Cancel("cleaning up")
|
||||
@ -1640,6 +1637,13 @@ func (e *WorkloadExecutor) runBarrierOp(opIndex int, op *barrierOp) {
|
||||
}
|
||||
}
|
||||
|
||||
func (e *WorkloadExecutor) runSleepOp(op *sleepOp) {
|
||||
select {
|
||||
case <-(*e.tCtx).Done():
|
||||
case <-time.After(op.Duration.Duration):
|
||||
}
|
||||
}
|
||||
|
||||
func (e *WorkloadExecutor) runStopCollectingMetrics(opIndex int) {
|
||||
items := stopCollectingMetrics(*e.tCtx, *e.collectorCtx, e.collectorWG, e.workload.Threshold, *e.workload.ThresholdMetricSelector, opIndex, e.collectors)
|
||||
e.dataItems = append(e.dataItems, items...)
|
||||
|
Loading…
Reference in New Issue
Block a user