mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-12-01 17:44:30 +00:00
Merge pull request #99644 from gavinfish/sched-param
Scheduler: make parallelism as part of schedulerOptions
This commit is contained in:
@@ -996,11 +996,19 @@ func TestDryRunPreemption(t *testing.T) {
|
||||
registeredPlugins = append(registeredPlugins, tt.registerPlugins...)
|
||||
objs := []runtime.Object{&v1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: ""}}}
|
||||
informerFactory := informers.NewSharedInformerFactory(clientsetfake.NewSimpleClientset(objs...), 0)
|
||||
parallelism := parallelize.DefaultParallelism
|
||||
if tt.disableParallelism {
|
||||
// We need disableParallelism because of the non-deterministic nature
|
||||
// of the results of tests that set custom minCandidateNodesPercentage
|
||||
// or minCandidateNodesAbsolute. This is only done in a handful of tests.
|
||||
parallelism = 1
|
||||
}
|
||||
fwk, err := st.NewFramework(
|
||||
registeredPlugins, "",
|
||||
frameworkruntime.WithPodNominator(internalqueue.NewPodNominator()),
|
||||
frameworkruntime.WithSnapshotSharedLister(snapshot),
|
||||
frameworkruntime.WithInformerFactory(informerFactory),
|
||||
frameworkruntime.WithParallelism(parallelism),
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -1019,17 +1027,6 @@ func TestDryRunPreemption(t *testing.T) {
|
||||
return nodeInfos[i].Node().Name < nodeInfos[j].Node().Name
|
||||
})
|
||||
|
||||
if tt.disableParallelism {
|
||||
// We need disableParallelism because of the non-deterministic nature
|
||||
// of the results of tests that set custom minCandidateNodesPercentage
|
||||
// or minCandidateNodesAbsolute. This is only done in a handful of tests.
|
||||
oldParallelism := parallelize.GetParallelism()
|
||||
parallelize.SetParallelism(1)
|
||||
t.Cleanup(func() {
|
||||
parallelize.SetParallelism(oldParallelism)
|
||||
})
|
||||
}
|
||||
|
||||
if tt.args == nil {
|
||||
tt.args = getDefaultDefaultPreemptionArgs()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user