Update the tests to check for only one update finalizer operation

This commit is contained in:
nikhiljindal 2017-02-02 22:02:28 -08:00
parent 78ab9ae218
commit 64643c6582
3 changed files with 3 additions and 6 deletions

View File

@ -97,10 +97,9 @@ func TestDaemonSetController(t *testing.T) {
// Test add federated daemonset.
daemonsetWatch.Add(&daemonset1)
// There should be 2 updates to add both the finalizers.
// There should be an update to add both the finalizers.
updatedDaemonSet := GetDaemonSetFromChan(daemonsetUpdateChan)
assert.True(t, daemonsetController.hasFinalizerFunc(updatedDaemonSet, deletionhelper.FinalizerDeleteFromUnderlyingClusters))
updatedDaemonSet = GetDaemonSetFromChan(daemonsetUpdateChan)
assert.True(t, daemonsetController.hasFinalizerFunc(updatedDaemonSet, metav1.FinalizerOrphan))
daemonset1 = *updatedDaemonSet

View File

@ -140,10 +140,9 @@ func TestIngressController(t *testing.T) {
assert.Equal(t, cluster.ObjectMeta.Annotations[uidAnnotationKey], cfg1.Data[uidKey])
t.Logf("Checking that appropriate finalizers are added")
// There should be 2 updates to add both the finalizers.
// There should be an update to add both the finalizers.
updatedIngress := GetIngressFromChan(t, fedIngressUpdateChan)
assert.True(t, ingressController.hasFinalizerFunc(updatedIngress, deletionhelper.FinalizerDeleteFromUnderlyingClusters))
updatedIngress = GetIngressFromChan(t, fedIngressUpdateChan)
assert.True(t, ingressController.hasFinalizerFunc(updatedIngress, metav1.FinalizerOrphan), fmt.Sprintf("ingress does not have the orphan finalizer: %v", updatedIngress))
fedIngress = *updatedIngress

View File

@ -97,10 +97,9 @@ func TestSecretController(t *testing.T) {
// Test add federated secret.
secretWatch.Add(&secret1)
// There should be 2 updates to add both the finalizers.
// There should be an update to add both the finalizers.
updatedSecret := GetSecretFromChan(secretUpdateChan)
assert.True(t, secretController.hasFinalizerFunc(updatedSecret, deletionhelper.FinalizerDeleteFromUnderlyingClusters))
updatedSecret = GetSecretFromChan(secretUpdateChan)
assert.True(t, secretController.hasFinalizerFunc(updatedSecret, metav1.FinalizerOrphan))
secret1 = *updatedSecret