Skip to content

test: fix flaky test EmbeddedDartReportApiTest - #19905

Draft
FrankChen021 wants to merge 1 commit into
apache:masterfrom
FrankChen021:codex/fix-dart-report-duration-race
Draft

test: fix flaky test EmbeddedDartReportApiTest#19905
FrankChen021 wants to merge 1 commit into
apache:masterfrom
FrankChen021:codex/fix-dart-report-duration-race

Conversation

@FrankChen021

Copy link
Copy Markdown
Member

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:

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.

@FrankChen021 FrankChen021 changed the title test: wait for completed Dart reports in embedded tests test: fix flaky test EmbeddedDartReportApiTest Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant