smengcl opened a new pull request, #10720:
URL: https://github.com/apache/ozone/pull/10720

   Generated-by: Claude Code (Opus 4.8)
   
   ## What changes were proposed in this pull request?
   
   `TestStorageVolumeChecker#testNumScansSkipped` fails intermittently with 
`expected: <1> but was: <2>` (seen in upstream CI on 2026-07-09).
   
   The test uses the real `ThrottledAsyncChecker`, which runs volume checks on 
a background executor and wraps them with `Futures.withTimeout`. The callback 
that records each check's `completedAt` runs on those executor threads. On a 
busy JVM this races with the test's `timer.advance()`, so a check's 
`completedAt` is occasionally recorded against a later timer value. On the 
third `checkAllVolumes` call the affected volume then looks like it is still 
within `minMsBetweenChecks` and is skipped, which inflates `numScansSkipped` 
from 1 to 2.
   
   This PR makes the check synchronous for this test by installing a 
`ThrottledAsyncChecker` backed by a direct executor service, and by setting 
`diskCheckTimeout` to zero so no `Futures.withTimeout` wrapper is created. 
`completedChecks` is then fully populated before `checkAllVolumes` returns, 
which removes the race. The throttling gap (`getDiskCheckMinGap`) is unchanged, 
so the test still verifies skip counting, and the asynchronous per volume 
timeout path stays covered by the dedicated test added in HDDS-14871. The 
change is limited to the test.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-15822
   
   ## How was this patch tested?
   
   Ran `testNumScansSkipped` 100 times locally with 0 failures. Ran the full 
`TestStorageVolumeChecker` class (20 tests) multiple times with no failures. 
Checkstyle clean.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to