Skip to content

Commit aee13fb

Browse files
Merge pull request #1111 from dinhxuanvu/fix-flaky-e2e
Fix several flaky e2e test cases
2 parents a884018 + 6b9a6f6 commit aee13fb

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

test/e2e/installplan_e2e_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,8 @@ func TestCreateInstallPlanWithPreExistingCRDOwners(t *testing.T) {
659659
// Update the subscription resource to point to the beta CSV
660660
err = crc.OperatorsV1alpha1().Subscriptions(testNamespace).DeleteCollection(metav1.NewDeleteOptions(0), metav1.ListOptions{})
661661
require.NoError(t, err)
662+
// Delete orphaned csv
663+
require.NoError(t, crc.OperatorsV1alpha1().ClusterServiceVersions(testNamespace).Delete(mainStableCSV.GetName(), &metav1.DeleteOptions{}))
662664

663665
// existing cleanup should remove this
664666
createSubscriptionForCatalog(t, crc, testNamespace, subscriptionName, mainCatalogSourceName, mainPackageName, betaChannel, "", v1alpha1.ApprovalAutomatic)
@@ -1192,6 +1194,8 @@ func TestInstallPlanWithDeprecatedVersionCRD(t *testing.T) {
11921194
// Update the subscription resource to point to the beta CSV
11931195
err = crc.OperatorsV1alpha1().Subscriptions(testNamespace).DeleteCollection(metav1.NewDeleteOptions(0), metav1.ListOptions{})
11941196
require.NoError(t, err)
1197+
// Delete orphaned csv
1198+
require.NoError(t, crc.OperatorsV1alpha1().ClusterServiceVersions(testNamespace).Delete(mainStableCSV.GetName(), &metav1.DeleteOptions{}))
11951199

11961200
// existing cleanup should remove this
11971201
createSubscriptionForCatalog(t, crc, testNamespace, subscriptionName, mainCatalogSourceName, mainPackageName, betaChannel, "", v1alpha1.ApprovalAutomatic)
@@ -1241,6 +1245,8 @@ func TestInstallPlanWithDeprecatedVersionCRD(t *testing.T) {
12411245
// Update the subscription resource to point to the beta CSV
12421246
err = crc.OperatorsV1alpha1().Subscriptions(testNamespace).DeleteCollection(metav1.NewDeleteOptions(0), metav1.ListOptions{})
12431247
require.NoError(t, err)
1248+
// Delete orphaned csv
1249+
require.NoError(t, crc.OperatorsV1alpha1().ClusterServiceVersions(testNamespace).Delete(mainBetaCSV.GetName(), &metav1.DeleteOptions{}))
12441250

12451251
// existing cleanup should remove this
12461252
createSubscriptionForCatalog(t, crc, testNamespace, subscriptionName, mainCatalogSourceName, mainPackageName, deltaChannel, "", v1alpha1.ApprovalAutomatic)

test/e2e/subscription_e2e_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,8 @@ func TestSubscriptionUpdatesExistingInstallPlan(t *testing.T) {
921921
// Delete this subscription
922922
err = crc.OperatorsV1alpha1().Subscriptions(testNamespace).DeleteCollection(metav1.NewDeleteOptions(0), metav1.ListOptions{})
923923
require.NoError(t, err)
924+
// Delete orphaned csvB
925+
require.NoError(t, crc.OperatorsV1alpha1().ClusterServiceVersions(testNamespace).Delete(csvB.GetName(), &metav1.DeleteOptions{}))
924926

925927
// Create an InstallPlan for csvB
926928
ip := &v1alpha1.InstallPlan{

0 commit comments

Comments
 (0)