HDDS-15828. Fix flaky TestDirectoryDeletingServiceWithFSO snapshot cleanup - #11212
Open
arunsarin85 wants to merge 3 commits into
Open
HDDS-15828. Fix flaky TestDirectoryDeletingServiceWithFSO snapshot cleanup#11212arunsarin85 wants to merge 3 commits into
arunsarin85 wants to merge 3 commits into
Conversation
…eanup. Wait for SnapshotDeletingService to purge deleted snapshots before snapshot tests return on the shared mini-cluster, so later tests do not chain off stale global snapshot entries. Co-authored-by: Cursor <cursoragent@cursor.com> Change-Id: I57ec596cd5870b68f21ff9d9a89850ea9832f56e
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…waitForSnapshotsPurged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Addresses review comments on #10726 (jojochuang's original patch for HDDS-15828).
Previously,
testAOSKeyDeletingWithSnapshotCreateParallelExecutionsuspended bothSnapshotDeletingServiceandDirectoryDeletingServicebut only resumed them on thesuccess path. If an assertion failed before the resume calls, later tests in the shared
static cluster ran with services still suspended, causing cascading flakiness.
Please describe your PR in detail:
snapshotCountAfterTest,pendingResumeDds,needsTableCleanup) to track per-test cleanup state.@AfterEach cleanup()to: resumeSnapshotDeletingService(viawaitForSnapshotsPurged) andDirectoryDeletingServiceif suspended, andcall
cleanupTables()if needed — guaranteeing cleanup runs even on test failure.waitForSnapshotsPurged+dirDeletingService.resume()callsout of
testAOSKeyDeletingWithSnapshotCreateParallelExecutionand into@AfterEach.waitForSnapshotsPurged+cleanupTables()callsout of
testDirDeletedTableCleanUpForSnapshotand into@AfterEach.awaitDoubleBufferFlush()beforewaitForSnapshotsPurgedin
testDirDeletedTableCleanUpForSnapshot(suggested by SaketaChalamchala).waitForSnapshotsPurgedlambda (checkstyle).assertTableRowCountafterwaitForinwaitForSnapshotsPurged—
waitForalready guarantees the condition before returning, calling it againdoubles the potential wait time (up to 4 minutes on slow runs).
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-15828
How was this patch tested?
https://github.com/arunsarin85/ozone/actions/runs/33992835360