@@ -892,10 +892,12 @@ func TestBindPlugin(t *testing.T) {
892
892
},
893
893
}
894
894
895
- // Create the master and the scheduler with the test plugin set.
895
+ // Create the scheduler with the test plugin set.
896
896
testCtx := testutils .InitTestSchedulerWithOptions (t , testContext , false , nil , time .Second ,
897
897
scheduler .WithProfiles (prof ),
898
898
scheduler .WithFrameworkOutOfTreeRegistry (registry ))
899
+ testutils .SyncInformerFactory (testCtx )
900
+ go testCtx .Scheduler .Run (testCtx .Ctx )
899
901
defer testutils .CleanupTest (t , testCtx )
900
902
901
903
// Add a few nodes.
@@ -1552,14 +1554,17 @@ func TestPreemptWithPermitPlugin(t *testing.T) {
1552
1554
}
1553
1555
1554
1556
func initTestSchedulerForFrameworkTest (t * testing.T , testCtx * testutils.TestContext , nodeCount int , opts ... scheduler.Option ) * testutils.TestContext {
1555
- c := testutils .InitTestSchedulerWithOptions (t , testCtx , false , nil , time .Second , opts ... )
1557
+ testCtx = testutils .InitTestSchedulerWithOptions (t , testCtx , false , nil , time .Second , opts ... )
1558
+ testutils .SyncInformerFactory (testCtx )
1559
+ go testCtx .Scheduler .Run (testCtx .Ctx )
1560
+
1556
1561
if nodeCount > 0 {
1557
- _ , err := createNodes (c .ClientSet , "test-node" , nil , nodeCount )
1562
+ _ , err := createNodes (testCtx .ClientSet , "test-node" , nil , nodeCount )
1558
1563
if err != nil {
1559
1564
t .Fatalf ("Cannot create nodes: %v" , err )
1560
1565
}
1561
1566
}
1562
- return c
1567
+ return testCtx
1563
1568
}
1564
1569
1565
1570
// initRegistryAndConfig returns registry and plugins config based on give plugins.
0 commit comments