Skip to content

Commit 2e0d5de

Browse files
author
Per Goncalves da Silva
committed
fix subscription e2e test flake
Signed-off-by: Per Goncalves da Silva <[email protected]>
1 parent 9768d61 commit 2e0d5de

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/e2e/subscription_e2e_test.go

+18
Original file line numberDiff line numberDiff line change
@@ -2840,6 +2840,24 @@ properties:
28402840
_, err = fetchCSV(crc, generatedNamespace.GetName(), subscription.Status.CurrentCSV, buildCSVConditionChecker(operatorsv1alpha1.CSVPhaseSucceeded))
28412841
Expect(err).ShouldNot(HaveOccurred())
28422842

2843+
By("waiting for the subscription bundle unpack conditions to be scrubbed")
2844+
// This step removes flakes from this test where the conditions on the subscription haven't been
2845+
// updated by the time the Consistently block executed a couple of steps below to ensure that the unpack
2846+
// job has not been retried
2847+
Eventually(func() error {
2848+
fetched, err := crc.OperatorsV1alpha1().Subscriptions(generatedNamespace.GetName()).Get(context.Background(), subName, metav1.GetOptions{})
2849+
if err != nil {
2850+
return err
2851+
}
2852+
if cond := fetched.Status.GetCondition(operatorsv1alpha1.SubscriptionBundleUnpacking); cond.Status == corev1.ConditionTrue {
2853+
return fmt.Errorf("unexpected condition status for %s on subscription %s", operatorsv1alpha1.SubscriptionBundleUnpacking, subName)
2854+
}
2855+
if cond := fetched.Status.GetCondition(operatorsv1alpha1.SubscriptionBundleUnpackFailed); cond.Status == corev1.ConditionTrue {
2856+
return fmt.Errorf("unexpected condition status for %s on subscription %s", operatorsv1alpha1.SubscriptionBundleUnpackFailed, subName)
2857+
}
2858+
return nil
2859+
}).Should(Succeed())
2860+
28432861
By("patching operator group to enable unpack retries")
28442862
ogNN := types.NamespacedName{Name: operatorGroup.GetName(), Namespace: generatedNamespace.GetName()}
28452863
setBundleUnpackRetryMinimumIntervalAnnotation(context.Background(), ctx.Ctx().Client(), ogNN, "1s")

0 commit comments

Comments
 (0)