diff --git a/test/integration/scheduler_perf/scheduler_perf_test.go b/test/integration/scheduler_perf/scheduler_perf_test.go index 338f948294d..df5884087f5 100644 --- a/test/integration/scheduler_perf/scheduler_perf_test.go +++ b/test/integration/scheduler_perf/scheduler_perf_test.go @@ -111,6 +111,17 @@ func (tc *testCase) collectsMetrics() bool { return false } +func (tc *testCase) workloadNamesUnique() error { + workloadUniqueNames := map[string]bool{} + for _, w := range tc.Workloads { + if workloadUniqueNames[w.Name] { + return fmt.Errorf("%s: workload name %s is not unique", tc.Name, w.Name) + } + workloadUniqueNames[w.Name] = true + } + return nil +} + // workload is a subtest under a testCase that tests the scheduler performance // for a certain ordering of ops. The set of nodes created and pods scheduled // in a workload may be heterogeneous. @@ -766,10 +777,18 @@ func validateTestCases(testCases []*testCase) error { if len(testCases) == 0 { return fmt.Errorf("no test cases defined") } + testCaseUniqueNames := map[string]bool{} for _, tc := range testCases { + if testCaseUniqueNames[tc.Name] { + return fmt.Errorf("%s: name is not unique", tc.Name) + } + testCaseUniqueNames[tc.Name] = true if len(tc.Workloads) == 0 { return fmt.Errorf("%s: no workloads defined", tc.Name) } + if err := tc.workloadNamesUnique(); err != nil { + return err + } if len(tc.WorkloadTemplate) == 0 { return fmt.Errorf("%s: no ops defined", tc.Name) }