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

   ## Summary
   
   - Wait for completed Dart query reports before asserting completion metadata.
   - Apply the same synchronization to the single-broker completed-report test 
and the cross-broker test.
   
   ## Root cause
   
   The master CI failure was reported as `expected: not <null>` at 
`EmbeddedDartReportApiTest.java:348`, which is the assertion that 
`DartQueryInfo.getDurationMs()` is non-null. The report response itself was 
present.
   
   The SQL result can be returned before `ControllerHolder.runAsync` finishes 
deregistration and `DartControllerRegistry` publishes the retained completed 
report. During that window, the report API can return the running-query 
snapshot, whose `durationMs` is explicitly null. Cross-broker forwarding can 
observe the same intermediate state.
   
   Evidence:
   
   - [Failed master 
job](https://github.com/apache/druid/actions/runs/31102715850/job/92620026819)
   - [Same test passed on the immediate parent 
run](https://github.com/apache/druid/actions/runs/31102703521/job/92619984800)
   - [Report metadata is documented as null until 
known](https://github.com/apache/druid/blob/master/multi-stage-query/src/main/java/org/apache/druid/msq/dart/controller/http/DartQueryInfo.java#L162-L170)
   - [Controller deregistration publishes the completed report after query 
execution](https://github.com/apache/druid/blob/master/multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerHolder.java#L205-L220)
   
   ## Fix
   
   Poll the report API until each requested broker returns a report with 
non-null `durationMs`, using one shared timeout for the multi-broker check. 
This synchronizes the test with the API's completed-report state without adding 
a fixed sleep.
   
   ## Validation
   
   ```
   mvn -ntp test -pl embedded-tests -am \
     -Dtest="org.apache.druid.testing.embedded.msq.EmbeddedDartReportApiTest" \
     -Dsurefire.failIfNoSpecifiedTests=false \
     -Pskip-static-checks -Dweb.console.skip=true -T1C
   ```
   
   Result: 7 tests passed, 0 failures, 0 errors.
   


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