Skip to content

HDDS-15828. Fix flaky TestDirectoryDeletingServiceWithFSO snapshot cleanup - #11212

Open
arunsarin85 wants to merge 3 commits into
apache:masterfrom
arunsarin85:HDDS-15828-local
Open

HDDS-15828. Fix flaky TestDirectoryDeletingServiceWithFSO snapshot cleanup#11212
arunsarin85 wants to merge 3 commits into
apache:masterfrom
arunsarin85:HDDS-15828-local

Conversation

@arunsarin85

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Addresses review comments on #10726 (jojochuang's original patch for HDDS-15828).
Previously, testAOSKeyDeletingWithSnapshotCreateParallelExecution suspended both
SnapshotDeletingService and DirectoryDeletingService but only resumed them on the
success 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:

  • Add three instance fields (snapshotCountAfterTest, pendingResumeDds,
    needsTableCleanup) to track per-test cleanup state.
  • Expand @AfterEach cleanup() to: resume SnapshotDeletingService (via
    waitForSnapshotsPurged) and DirectoryDeletingService if suspended, and
    call cleanupTables() if needed — guaranteeing cleanup runs even on test failure.
  • Move the end-of-test waitForSnapshotsPurged + dirDeletingService.resume() calls
    out of testAOSKeyDeletingWithSnapshotCreateParallelExecution and into @AfterEach.
  • Move the end-of-test waitForSnapshotsPurged + cleanupTables() calls
    out of testDirDeletedTableCleanUpForSnapshot and into @AfterEach.
  • Remove the redundant awaitDoubleBufferFlush() before waitForSnapshotsPurged
    in testDirDeletedTableCleanUpForSnapshot (suggested by SaketaChalamchala).
  • Fix mis-indented try/catch braces in the waitForSnapshotsPurged lambda (checkstyle).
  • Remove the redundant assertTableRowCount after waitFor in waitForSnapshotsPurged
    waitFor already guarantees the condition before returning, calling it again
    doubles 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

jojochuang and others added 3 commits July 10, 2026 18:30
…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>
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.

2 participants