georgew5656 opened a new pull request, #14178: URL: https://github.com/apache/druid/pull/14178
There are some build failures (https://github.com/apache/druid/actions/runs/4815370013/jobs/8580557362?pr=14175) due to HttpServerInventoryViewTest.testSyncMonitoring. This PR will hopefully fix those flakey test issues. ### Description I think the test fails occasionally because the test calls serverAdded on three servers and then immediately calls syncMonitoring, assuming that the three recently added servers will be newly synced and the logic in syncMonitoring will skip them. Calling serverAdded on a server will create a DruidServerHolder for the server and then call start() on the underlying ChangeRequestHttpSyncer object. The start() call will schedule a execution of the sync() method but not guarantee execution before the serverAdded returns. Because of this the unit test can sometimes call syncMonitoring before sync() has been called on all of the ChangeRequestHttpSyncer objects. This causes serverHolder.syncer.isOK() to return false and eventually leads to the emit call that is failing in the tests. #### Release note Fix to flaky unit test ##### Key changed/added classes in this PR Before calling syncMonitoring, make sure each of the server holders in HttpServerInventory has actually ran sync(). - [X] been self-reviewed. - [ ] using the [concurrency checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md) (Remove this item if the PR doesn't have any relation to concurrency.) - [ ] added documentation for new or modified features or behaviors. - [ ] a release note entry in the PR description. - [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links. - [ ] added or updated version, license, or notice information in [licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md) - [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader. - [X] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met. - [ ] added integration tests. - [ ] been tested in a test Druid cluster. -- 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]
