apupier opened a new pull request, #30484: URL: https://github.com/apache/camel/pull/30484
_Description generated by IBM Bob (AI) on behalf of @apupier_ JIRA: https://issues.apache.org/jira/browse/CAMEL-25232 ## Problem `SpringSimpleFileNameWithQuoteTest` is flaky on Jenkins (failed 2 times and flaky 4 times in the last 90 days): ``` java.lang.AssertionError: mock://result Body of message: 0. Expected: <Hello World!> but was: <> ``` The test sends a file with the file producer to the same directory that the route consumes with `delay=10`. The producer writes directly to the target file: it creates the (empty) file and only then writes the body. If the consumer polls between those two steps, it picks up an empty file. ## Fix Send the file with `tempPrefix=.inprogress-`: the producer writes a hidden temp file and renames it to `hello.txt` once the content is complete. The file consumer always skips names starting with a dot, so it can only see the complete file. ## How it was reproduced locally The race window is a few microseconds, so brute force did not hit it: 3000 runs in 30 parallel JVMs and 800 runs in fresh JVMs (60 at a time on 22 cores) all passed. To widen the window, a temporary (not committed) delay was added in `FileOperations.writeFileByString`: create the empty target file, sleep 100 ms, then write the body. | Test | Runs with the delay | Failures | |---|---|---| | Original | 5 | 5 (same error as on Jenkins) | | With this fix | 10 | 0 | -- 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]
