gnodet opened a new pull request, #24403:
URL: https://github.com/apache/camel/pull/24403

   ## Summary
   
   _Claude Code on behalf of Guillaume Nodet_
   
   Fixes `SpringFileWatcherTest.testDefaultConfig` which fails consistently on 
JDK 25 (3/3 attempts with `surefire.rerunFailingTestsCount=2`) while passing on 
JDK 17.
   
   **Root cause:** On JDK 25, the `WatchService` initializes faster and 
delivers a `CREATE` event for the file created in `@BeforeEach`, resulting in 3 
events total (1 CREATE + 2 MODIFY) instead of the expected 2. The test asserted 
an exact count of 2, which failed.
   
   **Changes:**
   - Use `expectedMinimumMessageCount(2)` instead of `setExpectedCount(2)` in 
`testDefaultConfig` to tolerate the additional CREATE event from `@BeforeEach` 
file creation on JDK 25+
   - Replace `Thread.sleep(50)` with Awaitility in both `testDefaultConfig` and 
`testCustomHasher` to properly wait for the watcher to process and hash the 
first write before the second one
   - Increase result wait time from 1s to 2s for CI robustness
   
   **CI evidence:** Failure observed in [CI run 
28625549853](https://github.com/apache/camel/actions/runs/28625549853), job 
`build (25, false)` (job ID 84959338713):
   ```
   mock://springTest Received message count. Expected: <2> but was: <3>
   ```
   
   ## Test plan
   
   - [x] `SpringFileWatcherTest.testDefaultConfig` passes locally
   - [x] `SpringFileWatcherTest.testCustomHasher` passes locally
   - [x] All 9 camel-file-watch tests pass (0 failures, 1 skipped = 
pre-existing `@Disabled` test)
   - [x] Code formatted with `mvn formatter:format impsort:sort`
   - [ ] CI passes on JDK 25
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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]

Reply via email to