rishi-rana opened a new pull request, #20549:
URL: https://github.com/apache/druid/pull/20549

   Fixes #20435.
   
   ### Description
   
   `test_streamLogs_ofCancelledTask` polls `TaskLogStreamer#streamTaskLog` with 
`waitForResult(..., Optional::isPresent)`. In the Docker-based embedded test 
setup, the peon pushes its log after the process exits, so the stream can 
become present (e.g. an empty file/handle) before the expected content has 
actually been written. This makes the test's `assertFalse(logs.isEmpty())` fail 
intermittently.
   
   This PR moves the log read into the polling supplier itself and changes the 
match condition to wait until the log content contains the expected line 
(`Running task[%s] for [%d] millis`), rather than just waiting for the stream 
to be present.
   
   #### Fixed the race in `test_streamLogs_ofCancelledTask`
   
   Polls on log content instead of stream presence, so the test waits out the 
delayed log push instead of racing it.
   
   #### Release note
   
   N/A — test-only change, no user-facing impact.
   
   <hr>
   
   ##### Key changed/added classes in this PR
    * `IngestionSmokeTest`
   
   <hr>
   
   This PR has:
   
   - [x] been self-reviewed.
   - [x] added unit tests or modified existing tests to cover new code paths, 
ensuring the threshold for code coverage is met.
   
   ---
   
   Assisted with AI Claude.


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