diff --git a/test/integration/scheduler_perf/util.go b/test/integration/scheduler_perf/util.go index 8175f51486c..e8dc65fa04c 100644 --- a/test/integration/scheduler_perf/util.go +++ b/test/integration/scheduler_perf/util.go @@ -98,11 +98,10 @@ func mustSetupCluster(tCtx ktesting.TContext, config *config.KubeSchedulerConfig if err != nil { tCtx.Fatalf("start apiserver: %v", err) } + // Cleanup will be in reverse order: first the clients by canceling the + // child context (happens automatically), then the server. tCtx.Cleanup(server.TearDownFn) - - // Cleanup will be in reverse order: first the clients get cancelled, - // then the apiserver is torn down via the automatic cancelation of - // tCtx. + tCtx = ktesting.WithCancel(tCtx) // TODO: client connection configuration, such as QPS or Burst is configurable in theory, this could be derived from the `config`, need to // support this when there is any testcase that depends on such configuration.