kfaraz commented on code in PR #19905:
URL: https://github.com/apache/druid/pull/19905#discussion_r3772337534
##########
embedded-tests/src/test/java/org/apache/druid/testing/embedded/msq/EmbeddedDartReportApiTest.java:
##########
@@ -606,6 +605,48 @@ private GetQueryReportResponse waitForReport(String
sqlQueryId)
throw new ISE("Timed out after[%,d] ms waiting for query to be in RUNNING
state", timeout);
}
+ /**
+ * Polls the report API on the specified brokers until completed reports are
available from all of them.
+ */
+ private List<GetQueryReportResponse> waitForCompletedReports(
+ final String sqlQueryId,
+ final EmbeddedBroker... targetBrokers
+ )
+ {
+ final long timeout = 30_000;
+ final long deadline = System.currentTimeMillis() + timeout;
+
+ while (System.currentTimeMillis() < deadline) {
Review Comment:
Instead of sleep, consider using `cluster.callApi().waitForResult()`.
--
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]