mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #40673 from kargakis/unit-test-fix
Automatic merge from submit-queue controller: don't run informers in unit tests when unnecessary Fixes https://github.com/kubernetes/kubernetes/issues/39908 @mfojtik it seems that using informers makes the deployment sync for the initial relist so this races with the enqueue that these tests are testing.
This commit is contained in:
commit
914402281b
@ -497,16 +497,13 @@ func TestPodDeletionEnqueuesRecreateDeployment(t *testing.T) {
|
||||
f.rsLister = append(f.rsLister, rs)
|
||||
f.objects = append(f.objects, foo, rs)
|
||||
|
||||
c, informers := f.newController()
|
||||
c, _ := f.newController()
|
||||
enqueued := false
|
||||
c.enqueueDeployment = func(d *extensions.Deployment) {
|
||||
if d.Name == "foo" {
|
||||
enqueued = true
|
||||
}
|
||||
}
|
||||
stopCh := make(chan struct{})
|
||||
defer close(stopCh)
|
||||
informers.Start(stopCh)
|
||||
|
||||
c.deletePod(pod)
|
||||
|
||||
@ -532,16 +529,13 @@ func TestPodDeletionDoesntEnqueueRecreateDeployment(t *testing.T) {
|
||||
// return a non-empty list.
|
||||
f.podLister = append(f.podLister, pod)
|
||||
|
||||
c, informers := f.newController()
|
||||
c, _ := f.newController()
|
||||
enqueued := false
|
||||
c.enqueueDeployment = func(d *extensions.Deployment) {
|
||||
if d.Name == "foo" {
|
||||
enqueued = true
|
||||
}
|
||||
}
|
||||
stopCh := make(chan struct{})
|
||||
defer close(stopCh)
|
||||
informers.Start(stopCh)
|
||||
|
||||
c.deletePod(pod)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user