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

   Related to #20312 (item 3, `QueryLaningTest`).
   
   ### Description
   
   `QueryLaningTest.test_queryUsesLaneInQueryContext_inManualStrategy` failed 
on master with:
   
   ```
   ISE: Timed out waiting for event after [100,000]ms
     at LatchableEmitter.waitForEventAggregate
     at 
EmbeddedClusterApis.waitForAllSegmentsToBeAvailable(EmbeddedClusterApis.java:316)
     at QueryTestBase.ingestBasicData(QueryTestBase.java:131)
   ```
   
   Example: 
https://github.com/apache/druid/actions/runs/34432737655/job/102731457738.
   
   `waitForAllSegmentsToBeAvailable` waits for the aggregate 
`segment/schemaCache/refresh/count` emitted by the Broker to reach the number 
of used segments. That is an indirect signal for what the query tests actually 
need: the segments being available and the datasource being present in the SQL 
schema.
   
   #### Changes
   
   * Add `EmbeddedClusterApis.waitForAllSegmentsToBeQueryable(dataSource, 
coordinator, timeoutMillis)`, which polls the Broker for the state SQL queries 
observe: the number of `is_available = 1` rows in `sys.segments` for the 
datasource reaching the number of non-tombstone used segments, and the 
datasource appearing in `INFORMATION_SCHEMA.TABLES`. It uses the existing 
`ResultWaiter` and reports the last observed value on timeout.
   * Use it from `QueryTestBase.ingestBasicData()`, which is the only call site 
changed. `waitForAllSegmentsToBeAvailable` and its other callers are untouched.
   
   Verified locally with `mvn -pl services,embedded-tests -am test-compile`. 
The embedded query tests were not run locally.
   
   <hr>
   
   ##### Key changed/added classes in this PR
    * `EmbeddedClusterApis`
    * `QueryTestBase`
   
   <hr>
   
   This PR has:
   
   - [x] been self-reviewed.
   


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