gitedmond opened a new pull request, #20479:
URL: https://github.com/apache/druid/pull/20479

   Fixes #20478.
   
   ### Description
   
   Stabilize `EmbeddedKafkaSupervisorTest` when Kafka tasks roll over or 
segment handoff is slower than ingestion.
   
   - List active tasks only and assert that the list is nonempty and every task 
is `RUNNING`, allowing the publishing task and its replacement to overlap.
   - Track the submitted supervisor and suspend it in `@AfterEach`, cancel 
remaining active tasks, and wait for them to finish so a failed assertion 
cannot leave ingestion running into the next test.
   - Emit Indexer metrics every 100 ms rather than waiting for the task's final 
emission.
   - Keep the empty-dimension test's 100 records within one day, use the 
default segment row limit, and allow ingestion to finish before time-based 
rollover. Removing the one-row limit alone would still create 100 daily 
segments.
   - Wait for handoff before checking empty-dimension rows and schema. Preserve 
the first test's ten-segment handoff and lock-release assertions.
   
   ### Validation
   
   - Java 25 compilation and Checkstyle passed on the final source.
   - Three full-class runs passed with retries disabled: 9 tests, no failures.
   - A temporary barrier waited for a completed task and an active replacement. 
The original exact-one assertion failed (`expected 1, got 2`); the fixed test 
passed with the same barrier. This exercises a valid rollover state, rather 
than claiming to reproduce the precise publishing overlap from CI.
   - A temporary assertion failure after task startup verified cleanup: the 
following test checked that supervisors were suspended and no tasks remained 
active, and both subsequent tests passed.
   
   Docker was unavailable locally. Runtime checks used real standalone Kafka 
4.3.0 through a temporary resource adapter; that adapter, the rollover barrier, 
and the injected failure are absent from this PR. The usual Docker-backed 
execution still needs CI verification. The empty-dimension timeout was 
confirmed in the referenced CI log but did not occur in the local baseline run.
   
   ##### Key changed classes
   
   - `EmbeddedKafkaSupervisorTest`
   
   This PR has:
   
   - [x] been self-reviewed.
   - [x] modified existing tests.
   - [x] added comments explaining timing and cleanup behavior.
   


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