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

   JIRA: https://issues.apache.org/jira/browse/CAMEL-25926
   
   ## Problem
   `FromSmbMoveWithExistingIT` is flaky with:
   
   ```
   java.lang.NullPointerException: Cannot read the array length because "bytes" 
is null
        at java.lang.String.<init>(String.java:1464)
        at 
...FromSmbMoveWithExistingIT.lambda$testRemoveExistingMoveFile$0(FromSmbMoveWithExistingIT.java:53)
   ```
   
   `copyFileContentFromContainer` returns `null` while the file does not exist 
yet. The test calls `new String(null)` inside Awaitility's `untilAsserted`, 
which throws a `NullPointerException` instead of an `AssertionError`. 
Awaitility only retries on assertion errors, so the test fails on the first 
poll instead of waiting for the file move.
   
   ## Fix
   - Add `SmbServerTestSupport.copyExistingFileContentFromContainer` which 
asserts the content is not null (an `AssertionError`, so Awaitility retries).
   - Use it in all SMB ITs that build a `String` from the container file 
content (same latent issue in many tests).
   
   ## Testing
   Full `camel-smb` module ITs run locally: 85 tests, 0 failures.
   
   ---
   _Description generated by IBM Bob 2.2.1 on behalf of apupier._


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