mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-06-11 01:41:54 -04:00
perf: fix scheduler_perf framework orphaned scheduler on timeout
This commit is contained in:
parent
8822656b90
commit
0ca2bdcf3f
1 changed files with 14 additions and 16 deletions
|
|
@ -799,6 +799,13 @@ func RunBenchmarkPerfScheduling(b *testing.B, configFile string, topicName strin
|
|||
|
||||
featureGates := featureGatesMerge(tc.FeatureGates, w.FeatureGates)
|
||||
scheduler, informerFactory, schedulerDone, tCtx := setupTestCase(b, tc, featureGates, w, opts)
|
||||
tCtx.TB().Cleanup(func() {
|
||||
tCtx.Cancel("workload is done")
|
||||
<-schedulerDone
|
||||
// Reset metrics to prevent metrics generated in current workload gets
|
||||
// carried over to the next workload.
|
||||
legacyregistry.Reset()
|
||||
})
|
||||
|
||||
err := w.isValid(tc.MetricsCollectorConfig)
|
||||
if err != nil {
|
||||
|
|
@ -846,14 +853,6 @@ func RunBenchmarkPerfScheduling(b *testing.B, configFile string, topicName strin
|
|||
tCtx.Errorf("%s: %s", w.Name, err)
|
||||
}
|
||||
|
||||
tCtx.Cancel("workload is done")
|
||||
// Wait for the scheduler to stop to avoid data races when resetting metrics.
|
||||
<-schedulerDone
|
||||
|
||||
// Reset metrics to prevent metrics generated in current workload gets
|
||||
// carried over to the next workload.
|
||||
legacyregistry.Reset()
|
||||
|
||||
// Exactly one result is expected to contain the progress information.
|
||||
for _, item := range results {
|
||||
if len(item.progress) == 0 {
|
||||
|
|
@ -923,6 +922,13 @@ func RunIntegrationPerfScheduling(t *testing.T, configFile string, options ...Sc
|
|||
}
|
||||
featureGates := featureGatesMerge(tc.FeatureGates, w.FeatureGates)
|
||||
scheduler, informerFactory, schedulerDone, tCtx := setupTestCase(t, tc, featureGates, w, opts)
|
||||
tCtx.TB().Cleanup(func() {
|
||||
tCtx.Cancel("workload is done")
|
||||
<-schedulerDone
|
||||
// Reset metrics to prevent metrics generated in current workload gets
|
||||
// carried over to the next workload.
|
||||
legacyregistry.Reset()
|
||||
})
|
||||
err := w.isValid(tc.MetricsCollectorConfig)
|
||||
if err != nil {
|
||||
t.Fatalf("workload %s is not valid: %v", w.Name, err)
|
||||
|
|
@ -937,14 +943,6 @@ func RunIntegrationPerfScheduling(t *testing.T, configFile string, options ...Sc
|
|||
if err = checkEmptyInFlightEvents(); err != nil {
|
||||
tCtx.Errorf("%s: %s", w.Name, err)
|
||||
}
|
||||
|
||||
tCtx.Cancel("workload is done")
|
||||
// Wait for the scheduler to stop to avoid data races when resetting metrics.
|
||||
<-schedulerDone
|
||||
|
||||
// Reset metrics to prevent metrics generated in current workload gets
|
||||
// carried over to the next workload.
|
||||
legacyregistry.Reset()
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue