Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix][test] Fix flaky test PersistentTopicTest.testGetReplicationClusters #19421

Conversation

lhotari
Copy link
Member

@lhotari lhotari commented Feb 3, 2023

Fixes #19418

Motivation

PersistentTopicTest.testGetReplicationClusters fails consistently. PersistentTopic.initialize() is async and the test didn't wait for it's completion.

Modifications

replace topic.initialize() with topic.initialize().join() in PersistentTopicTest class.

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

@lhotari lhotari added this to the 3.0.0 milestone Feb 3, 2023
@lhotari lhotari self-assigned this Feb 3, 2023
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Feb 3, 2023
Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

+1

@@ -2251,7 +2251,7 @@ private ByteBuf getMessageWithMetadata(byte[] data) {
@Test
public void testGetReplicationClusters() throws MetadataStoreException {
PersistentTopic topic = new PersistentTopic(successTopicName, ledgerMock, brokerService);
topic.initialize();
topic.initialize().join();
Copy link
Contributor

Choose a reason for hiding this comment

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

do we have a global timeout for single test?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes we do.

// Enforce default test timeout
if (annotation.getTimeOut() == 0) {
annotation.setTimeOut(DEFAULT_TEST_TIMEOUT_MILLIS);
}

@lhotari lhotari merged commit 91c7ef7 into apache:master Feb 3, 2023
@michaeljmarshall
Copy link
Member

Thank you for taking care of this @lhotari!

nodece pushed a commit to nodece/pulsar that referenced this pull request May 14, 2024
nodece pushed a commit to ascentstream/pulsar that referenced this pull request May 14, 2024
nodece pushed a commit to ascentstream/pulsar that referenced this pull request May 15, 2024
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.

Flaky-test: PersistentTopicTest.testGetReplicationClusters
5 participants