revert unit test
This commit is contained in:
		@@ -44,7 +44,6 @@ import (
 | 
				
			|||||||
	"k8s.io/kubernetes/pkg/features"
 | 
						"k8s.io/kubernetes/pkg/features"
 | 
				
			||||||
	"k8s.io/kubernetes/pkg/scheduler/framework"
 | 
						"k8s.io/kubernetes/pkg/scheduler/framework"
 | 
				
			||||||
	"k8s.io/kubernetes/pkg/scheduler/framework/plugins/queuesort"
 | 
						"k8s.io/kubernetes/pkg/scheduler/framework/plugins/queuesort"
 | 
				
			||||||
	"k8s.io/kubernetes/pkg/scheduler/framework/plugins/schedulinggates"
 | 
					 | 
				
			||||||
	"k8s.io/kubernetes/pkg/scheduler/metrics"
 | 
						"k8s.io/kubernetes/pkg/scheduler/metrics"
 | 
				
			||||||
	st "k8s.io/kubernetes/pkg/scheduler/testing"
 | 
						st "k8s.io/kubernetes/pkg/scheduler/testing"
 | 
				
			||||||
	"k8s.io/kubernetes/pkg/scheduler/util"
 | 
						"k8s.io/kubernetes/pkg/scheduler/util"
 | 
				
			||||||
@@ -3743,30 +3742,3 @@ func Test_isPodWorthRequeuing(t *testing.T) {
 | 
				
			|||||||
		})
 | 
							})
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					 | 
				
			||||||
func Test_queuedPodInfo_gatedSetUponCreationAndUnsetUponUpdate(t *testing.T) {
 | 
					 | 
				
			||||||
	logger, ctx := ktesting.NewTestContext(t)
 | 
					 | 
				
			||||||
	plugin, _ := schedulinggates.New(ctx, nil, nil)
 | 
					 | 
				
			||||||
	m := map[string][]framework.PreEnqueuePlugin{"": {plugin.(framework.PreEnqueuePlugin)}}
 | 
					 | 
				
			||||||
	q := NewTestQueue(ctx, newDefaultQueueSort(), WithPreEnqueuePluginMap(m))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	gatedPod := st.MakePod().SchedulingGates([]string{"hello world"}).Obj()
 | 
					 | 
				
			||||||
	if err := q.Add(logger, gatedPod); err != nil {
 | 
					 | 
				
			||||||
		t.Error("Error calling Add")
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if !q.unschedulablePods.get(gatedPod).Gated {
 | 
					 | 
				
			||||||
		t.Error("expected pod to be gated")
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	ungatedPod := gatedPod.DeepCopy()
 | 
					 | 
				
			||||||
	ungatedPod.Spec.SchedulingGates = nil
 | 
					 | 
				
			||||||
	if err := q.Update(logger, gatedPod, ungatedPod); err != nil {
 | 
					 | 
				
			||||||
		t.Error("Error calling Update")
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	ungatedPodInfo, _ := q.Pop(logger)
 | 
					 | 
				
			||||||
	if ungatedPodInfo.Gated {
 | 
					 | 
				
			||||||
		t.Error("expected pod to be ungated")
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user