From f214d8e27a0323a333bc0f7c8b52460e8f58f546 Mon Sep 17 00:00:00 2001 From: YamasouA Date: Thu, 27 Feb 2025 00:10:24 +0900 Subject: [PATCH] delete unnecessary init --- .../scheduler_perf/scheduler_perf.go | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/test/integration/scheduler_perf/scheduler_perf.go b/test/integration/scheduler_perf/scheduler_perf.go index c01f4f62fbf..dc8a00dd9b4 100644 --- a/test/integration/scheduler_perf/scheduler_perf.go +++ b/test/integration/scheduler_perf/scheduler_perf.go @@ -1497,27 +1497,13 @@ func runWorkload(tCtx ktesting.TContext, tc *testCase, w *workload, informerFact // Everything else started by this function gets stopped before it returns. tCtx = ktesting.WithCancel(tCtx) - var dataItems []DataItem - - var collectors []testDataCollector - // This needs a separate context and wait group because - // the metrics collecting needs to be sure that the goroutines - // are stopped. - var collectorCtx ktesting.TContext - executor := WorkloadExecutor{ tCtx: tCtx, - wg: sync.WaitGroup{}, - collectorCtx: collectorCtx, - collectorWG: sync.WaitGroup{}, - collectors: collectors, numPodsScheduledPerNamespace: make(map[string]int), podInformer: podInformer, throughputErrorMargin: throughputErrorMargin, testCase: tc, workload: w, - nextNodeIndex: 0, - dataItems: dataItems, } defer executor.wg.Wait() @@ -1566,7 +1552,7 @@ func runWorkload(tCtx ktesting.TContext, tc *testCase, w *workload, informerFact // Some tests have unschedulable pods. Do not add an implicit barrier at the // end as we do not want to wait for them. - return dataItems + return executor.dataItems } func (e *WorkloadExecutor) runCreateNodesOp(opIndex int, op *createNodesOp) { @@ -1715,7 +1701,7 @@ func (e *WorkloadExecutor) runDeletePodsOp(opIndex int, op *deletePodsOp) { } e.tCtx.Errorf("op %d: unable to delete pod %v: %v", opIndex, podsToDelete[i].Name, err) } - case <-(e.tCtx).Done(): + case <-e.tCtx.Done(): return } }