Skip to content

Register emitter to logger to avoid unit test failures#14180

Merged
clintropolis merged 1 commit intoapache:masterfrom
georgew5656:addLogger
Apr 28, 2023
Merged

Register emitter to logger to avoid unit test failures#14180
clintropolis merged 1 commit intoapache:masterfrom
georgew5656:addLogger

Conversation

@georgew5656
Copy link
Copy Markdown
Contributor

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
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 notes
Fix to flaky unit test

Key changed/added classes in this PR
Register a noop emitter so the emit call doesn't fail

Copy link
Copy Markdown
Member

@clintropolis clintropolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@clintropolis clintropolis merged commit d0654e2 into apache:master Apr 28, 2023
clintropolis pushed a commit to clintropolis/druid that referenced this pull request May 1, 2023
@clintropolis clintropolis added this to the 26.0 milestone May 1, 2023
clintropolis added a commit that referenced this pull request May 1, 2023
Co-authored-by: George Shiqi Wu <george.wu@imply.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants