Skip to content

Commit 1a6a03e

Browse files
authored
fix: wrap subscription e2e test logic in Eventually statement (#2392)
Signed-off-by: Daniel Sover <[email protected]>
1 parent 6b39352 commit 1a6a03e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: test/e2e/subscription_e2e_test.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -467,9 +467,11 @@ var _ = Describe("Subscription", func() {
467467
require.NoError(GinkgoT(), err)
468468

469469
// Wait for the subscription to begin upgrading to csvB
470-
subscription, err = fetchSubscription(crc, testNamespace, subscriptionName, subscriptionStateUpgradePendingChecker)
471-
require.NoError(GinkgoT(), err)
472-
require.NotEqual(GinkgoT(), fetchedInstallPlan.GetName(), subscription.Status.InstallPlanRef.Name, "expected new installplan for upgraded csv")
470+
// The upgrade changes the installplanref on the subscription
471+
Eventually(func() (bool, error) {
472+
subscription, err = crc.OperatorsV1alpha1().Subscriptions(testNamespace).Get(context.Background(), subscriptionName, metav1.GetOptions{})
473+
return subscription != nil && subscription.Status.InstallPlanRef.Name != fetchedInstallPlan.GetName() && subscription.Status.State == operatorsv1alpha1.SubscriptionStateUpgradePending, err
474+
}, 5*time.Minute, 1*time.Second).Should(BeTrue(), "expected new installplan for upgraded csv")
473475

474476
upgradeInstallPlan, err := fetchInstallPlan(GinkgoT(), crc, subscription.Status.InstallPlanRef.Name, requiresApprovalChecker)
475477
require.NoError(GinkgoT(), err)

0 commit comments

Comments
 (0)