-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[fix][test] Fix flaky test PersistentTopicTest.testGetReplicationClusters #19421
Conversation
There was a problem hiding this 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(); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we do.
pulsar/buildtools/src/main/java/org/apache/pulsar/tests/AnnotationListener.java
Lines 49 to 52 in 33f40f6
// Enforce default test timeout | |
if (annotation.getTimeOut() == 0) { | |
annotation.setTimeOut(DEFAULT_TEST_TIMEOUT_MILLIS); | |
} |
Thank you for taking care of this @lhotari! |
…ters (apache#19421) (cherry picked from commit 91c7ef7)
…ters (apache#19421) (cherry picked from commit 91c7ef7)
…ters (apache#19421) (cherry picked from commit 91c7ef7)
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()
withtopic.initialize().join()
in PersistentTopicTest class.Documentation
doc
doc-required
doc-not-needed
doc-complete