scheduler_perf: let the test decide which informers are needed

This will change when adding dynamic resource allocation test cases. Instead of
changing mustSetupScheduler and StartScheduler for that, let's return the
informer factory and create informers as needed in the test.
This commit is contained in:
Patrick Ohly
2023-02-03 16:13:20 +01:00
parent 969d28b12b
commit b3e0bc8864
3 changed files with 13 additions and 7 deletions

View File

@@ -750,7 +750,13 @@ func runWorkload(ctx context.Context, b *testing.B, tc *testCase, w *workload) [
b.Fatalf("validate scheduler config file failed: %v", err)
}
}
podInformer, client, dynClient := mustSetupScheduler(ctx, b, cfg)
informerFactory, client, dynClient := mustSetupScheduler(ctx, b, cfg)
// Additional informers needed for testing. The pod informer was
// already created before (scheduler.NewInformerFactory) and the
// factory was started for it (mustSetupScheduler), therefore we don't
// need to start again.
podInformer := informerFactory.Core().V1().Pods()
var mu sync.Mutex
var dataItems []DataItem