Move unschedulable Pod to internal schedulingQ synchronously

- use in-cache Pod instead of real-time Pod (by calling API server) to mark it as unschedulable
  in internal schedulingQ
- remove the backoff logic as now we don't call API server
- the whole logic is changed to a synchronous call
This commit is contained in:
Wei Huang
2020-04-30 15:51:25 -07:00
parent 938875582b
commit 133a02540f
4 changed files with 150 additions and 190 deletions

View File

@@ -1394,7 +1394,7 @@ func TestFilterPlugin(t *testing.T) {
}
// Create the master and the scheduler with the test plugin set.
testCtx := initTestSchedulerForFrameworkTest(t, testutils.InitTestMaster(t, "filter-plugin", nil), 2,
testCtx := initTestSchedulerForFrameworkTest(t, testutils.InitTestMaster(t, "filter-plugin", nil), 1,
scheduler.WithProfiles(prof),
scheduler.WithFrameworkOutOfTreeRegistry(registry))
defer testutils.CleanupTest(t, testCtx)
@@ -1418,8 +1418,8 @@ func TestFilterPlugin(t *testing.T) {
}
}
if filterPlugin.numFilterCalled == 0 {
t.Errorf("Expected the filter plugin to be called.")
if filterPlugin.numFilterCalled != 1 {
t.Errorf("Expected the filter plugin to be called 1 time, but got %v.", filterPlugin.numFilterCalled)
}
filterPlugin.reset()