Skip to content

test(e2e): delete MantleBackups after backup-failure tests to avoid interfering with subsequent tests#287

Merged
llamerada-jp merged 1 commit into
mainfrom
fix-backup-failure-test-flakiness
Jun 1, 2026
Merged

test(e2e): delete MantleBackups after backup-failure tests to avoid interfering with subsequent tests#287
llamerada-jp merged 1 commit into
mainfrom
fix-backup-failure-test-flakiness

Conversation

@skoya76

@skoya76 skoya76 commented May 28, 2026

Copy link
Copy Markdown
Contributor

The test "should handle removal of MantleBackup in secondary k8s cluster
during an incremental backup" was failing with a timeout.

When the previous test (primary MantleBackup deletion scenario) finishes, a
residual secondary MantleBackup is left behind in "waiting for export
data" state because its primary was deleted before the upload completed. When
the next test pauses RGW, the secondary reconciler gets blocked on S3
operations triggered by processing this residual MantleBackup, causing
kubectl delete --timeout=3m issued against the current test's secondary
MantleBackup to expire before finalizeSecondary could run.

Add CleanupMantleBackups to delete all MantleBackups on both clusters at the
end of each backup-failure test via DeferCleanup, so that no residual
MantleBackups remain when the next test starts.

@skoya76 skoya76 changed the title e2e: clean up namespaces after backup-failure tests to avoid interfer… e2e: clean up namespaces after backup-failure tests to avoid interfering with subsequent tests May 28, 2026
@skoya76 skoya76 force-pushed the fix-backup-failure-test-flakiness branch from ad07ebc to a1e68af Compare May 28, 2026 01:07
@skoya76 skoya76 requested a review from Copilot May 28, 2026 01:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the multi-cluster e2e “backup-failure” test suite to prevent residual MantleBackup resources from leaking between test cases by ensuring the test namespaces are deleted at the end of each failure scenario.

Changes:

  • Added a TearDownEnvironment(namespace) helper to delete the test namespace in both primary and secondary clusters.
  • Registered DeferCleanup hooks in backup_failure_test.go so teardown runs automatically after each backup-failure test case.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
test/e2e/multik8s/testutil/util.go Adds TearDownEnvironment helper to delete namespaces in both clusters.
test/e2e/multik8s/backup_failure_test.go Adds DeferCleanup calls to ensure namespaces are cleaned up after each test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/e2e/multik8s/testutil/util.go Outdated
Comment thread test/e2e/multik8s/testutil/util.go Outdated
Comment thread test/e2e/multik8s/backup_failure_test.go Outdated
@skoya76 skoya76 force-pushed the fix-backup-failure-test-flakiness branch 2 times, most recently from 9ee74c3 to 1b9d58d Compare May 28, 2026 07:56
@skoya76 skoya76 changed the title e2e: clean up namespaces after backup-failure tests to avoid interfering with subsequent tests test(e2e): delete MantleBackups after backup-failure tests to avoid interfering with subsequent tests May 28, 2026
@skoya76 skoya76 marked this pull request as ready for review May 28, 2026 08:57
@skoya76 skoya76 requested a review from a team as a code owner May 28, 2026 08:57
@skoya76 skoya76 requested review from llamerada-jp and ushitora-anqou and removed request for a team and ushitora-anqou May 28, 2026 08:57

@llamerada-jp llamerada-jp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you fail a CI, you may want to study the root cause using existing resources. It's better to keep the resource in that case. So, I suggest that you put CleanupMantleBackups without DeferCleanup at the end of test scenarios.

@skoya76 skoya76 force-pushed the fix-backup-failure-test-flakiness branch from 1b9d58d to 4154364 Compare May 29, 2026 08:16
…nterfering with subsequent tests

The test "should handle removal of MantleBackup in secondary k8s cluster
during an incremental backup" was failing with a timeout.

When the previous test (primary MantleBackup deletion scenario) finishes, a
residual secondary MantleBackup is left behind in "waiting for export
data" state because its primary was deleted before the upload completed. When
the next test pauses RGW, the secondary reconciler gets blocked on S3
operations triggered by processing this residual MantleBackup, causing
`kubectl delete --timeout=3m` issued against the current test's secondary
MantleBackup to expire before finalizeSecondary could run.

Add CleanupMantleBackups to delete all MantleBackups on both clusters at the
end of each backup-failure test via DeferCleanup, so that no residual
MantleBackups remain when the next test starts.

Signed-off-by: Kohya Shiozaki <kouyan120706@gmail.com>
@skoya76 skoya76 force-pushed the fix-backup-failure-test-flakiness branch from 4154364 to 3fbb1a9 Compare May 29, 2026 08:18
@skoya76

skoya76 commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, I changed it to clean up at the end of each test scenario.

@skoya76 skoya76 requested a review from llamerada-jp June 1, 2026 00:04
@llamerada-jp llamerada-jp merged commit a8d1c46 into main Jun 1, 2026
15 checks passed
@llamerada-jp llamerada-jp deleted the fix-backup-failure-test-flakiness branch June 1, 2026 00:46
@skoya76 skoya76 restored the fix-backup-failure-test-flakiness branch June 26, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants