Skip to content

HDDS-16135. Fix remaining intermittent failures in TestKeyLifecycleService - #11202

Open
shuan1026 wants to merge 1 commit into
apache:masterfrom
shuan1026:HDDS-16135
Open

HDDS-16135. Fix remaining intermittent failures in TestKeyLifecycleService#11202
shuan1026 wants to merge 1 commit into
apache:masterfrom
shuan1026:HDDS-16135

Conversation

@shuan1026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

HDDS-16135 reported intermittent failures in TestKeyLifecycleService$Normal#testNestedFSODirectoryScanResume. After HDDS-16033 / #11145 resolve the most of the issues, that method is stable. The full $Normal class still flakes in two other methods.

testScanStatePiggybackedOnDelete

The test reads OmLifecycleScanState once and asserts scanEndTime != null. After the first scan finishes, the lifecycle policy is still present, the next tick recreates the row with scanEndTime = null (a ~40ms window). The one-shot read can land in that window.

This change waits with GenericTestUtils.waitFor until a completed scan state is visible.

testMultipleDirectoriesMatched

The test renames a directory to refresh mtime and immediately unparks the scan. getSubDirectory() merges the dirTable cache with the RocksDB iterator and does not dedupe live entries, so the same directory can be evaluated twice: the cache copy and the DB copy. The stale copy still looks expired, so a just-renewed directory is deleted and waitFor(deletedDirectory == expected) never settles.

This change calls awaitDirCacheDrained after the rename.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-16135

How was this patch tested?

Before:
TestKeyLifecycleService$Normal#ALL (20x10 ALL) Fail
https://github.com/shuan1026/ozone/actions/runs/33775402686

After:
TestKeyLifecycleService$Normal#ALL (20x10 ALL) Pass
https://github.com/shuan1026/ozone/actions/runs/33849488601

Full CI:
https://github.com/shuan1026/ozone/actions/runs/33849024847

@shuan1026
shuan1026 marked this pull request as ready for review September 4, 2026 14:26

@chihsuan chihsuan 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.

Thanks @shuan1026 +1 LGTM

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