mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 12:07:47 +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:
|
case *barrierOp:
|
||||||
executor.runBarrierOp(opIndex, concreteOp)
|
executor.runBarrierOp(opIndex, concreteOp)
|
||||||
case *sleepOp:
|
case *sleepOp:
|
||||||
select {
|
executor.runSleepOp(concreteOp)
|
||||||
case <-tCtx.Done():
|
|
||||||
case <-time.After(concreteOp.Duration.Duration):
|
|
||||||
}
|
|
||||||
case *startCollectingMetricsOp:
|
case *startCollectingMetricsOp:
|
||||||
executor.runStartCollectingMetricsOp(opIndex, concreteOp)
|
executor.runStartCollectingMetricsOp(opIndex, concreteOp)
|
||||||
defer (*executor.collectorCtx).Cancel("cleaning up")
|
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) {
|
func (e *WorkloadExecutor) runStopCollectingMetrics(opIndex int) {
|
||||||
items := stopCollectingMetrics(*e.tCtx, *e.collectorCtx, e.collectorWG, e.workload.Threshold, *e.workload.ThresholdMetricSelector, opIndex, e.collectors)
|
items := stopCollectingMetrics(*e.tCtx, *e.collectorCtx, e.collectorWG, e.workload.Threshold, *e.workload.ThresholdMetricSelector, opIndex, e.collectors)
|
||||||
e.dataItems = append(e.dataItems, items...)
|
e.dataItems = append(e.dataItems, items...)
|
||||||
|
Loading…
Reference in New Issue
Block a user