Teardown only scheduler in integration tests

Signed-off-by: Kante Yin <kerthcet@gmail.com>
This commit is contained in:
Kante Yin
2023-04-24 14:22:51 +08:00
committed by kerthcet
parent d86b74b017
commit 2d866ec2fc
14 changed files with 377 additions and 495 deletions

View File

@@ -124,8 +124,7 @@ func TestSchedulingGates(t *testing.T) {
scheduler.WithPodInitialBackoffSeconds(0),
scheduler.WithPodMaxBackoffSeconds(0),
)
testutils.SyncInformerFactory(testCtx)
defer testutils.CleanupTest(t, testCtx)
testutils.SyncSchedulerInformerFactory(testCtx)
cs, ns, ctx := testCtx.ClientSet, testCtx.NS.Name, testCtx.Ctx
for _, p := range tt.pods {
@@ -186,9 +185,8 @@ func TestCoreResourceEnqueue(t *testing.T) {
scheduler.WithPodInitialBackoffSeconds(0),
scheduler.WithPodMaxBackoffSeconds(0),
)
testutils.SyncInformerFactory(testCtx)
testutils.SyncSchedulerInformerFactory(testCtx)
defer testutils.CleanupTest(t, testCtx)
defer testCtx.Scheduler.SchedulingQueue.Close()
cs, ns, ctx := testCtx.ClientSet, testCtx.NS.Name, testCtx.Ctx
@@ -371,7 +369,7 @@ func TestCustomResourceEnqueue(t *testing.T) {
scheduler.WithPodInitialBackoffSeconds(0),
scheduler.WithPodMaxBackoffSeconds(0),
)
testutils.SyncInformerFactory(testCtx)
testutils.SyncSchedulerInformerFactory(testCtx)
defer testutils.CleanupTest(t, testCtx)