test(e2e): delete MantleBackups after backup-failure tests to avoid interfering with subsequent tests#287
Conversation
ad07ebc to
a1e68af
Compare
There was a problem hiding this comment.
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
DeferCleanuphooks inbackup_failure_test.goso 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.
9ee74c3 to
1b9d58d
Compare
llamerada-jp
left a comment
There was a problem hiding this comment.
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.
1b9d58d to
4154364
Compare
…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>
4154364 to
3fbb1a9
Compare
|
Thanks, I changed it to clean up at the end of each test scenario. |
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=3missued against the current test's secondaryMantleBackup 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.