enhancement(scheduler): share waitingPods among profiles

This commit is contained in:
NoicFank
2024-01-24 21:21:21 +08:00
committed by kerthcet
parent 5ceb99dc6b
commit 31a4b13238
7 changed files with 229 additions and 8 deletions

View File

@@ -2808,7 +2808,9 @@ func TestPermitPlugins(t *testing.T) {
profile := config.KubeSchedulerProfile{Plugins: configPlugins}
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
f, err := newFrameworkWithQueueSortAndBind(ctx, registry, profile)
f, err := newFrameworkWithQueueSortAndBind(ctx, registry, profile,
WithWaitingPods(NewWaitingPodsMap()),
)
if err != nil {
t.Fatalf("fail to create framework: %s", err)
}
@@ -2990,7 +2992,10 @@ func TestRecordingMetrics(t *testing.T) {
SchedulerName: testProfileName,
Plugins: plugins,
}
f, err := newFrameworkWithQueueSortAndBind(ctx, r, profile, withMetricsRecorder(recorder))
f, err := newFrameworkWithQueueSortAndBind(ctx, r, profile,
withMetricsRecorder(recorder),
WithWaitingPods(NewWaitingPodsMap()),
)
if err != nil {
cancel()
t.Fatalf("Failed to create framework for testing: %v", err)
@@ -3160,7 +3165,9 @@ func TestPermitWaitDurationMetric(t *testing.T) {
profile := config.KubeSchedulerProfile{Plugins: plugins}
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
f, err := newFrameworkWithQueueSortAndBind(ctx, r, profile)
f, err := newFrameworkWithQueueSortAndBind(ctx, r, profile,
WithWaitingPods(NewWaitingPodsMap()),
)
if err != nil {
t.Fatalf("Failed to create framework for testing: %v", err)
}
@@ -3216,7 +3223,9 @@ func TestWaitOnPermit(t *testing.T) {
profile := config.KubeSchedulerProfile{Plugins: plugins}
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
f, err := newFrameworkWithQueueSortAndBind(ctx, r, profile)
f, err := newFrameworkWithQueueSortAndBind(ctx, r, profile,
WithWaitingPods(NewWaitingPodsMap()),
)
if err != nil {
t.Fatalf("Failed to create framework for testing: %v", err)
}