-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix][broker] Fix flaky testReplicatorsInflightTaskListIsEmptyAfterReplicationFinished#24590
[fix][broker] Fix flaky testReplicatorsInflightTaskListIsEmptyAfterReplicationFinished#24590lhotari merged 4 commits intoapache:masterfrom
Conversation
Fixes #24583
Motivation & Modifications
fix the flaky test testReplicatorsInflightTaskListIsEmptyAfterReplicationFinished
Documentation
-
doc -
doc-required -
doc-not-needed -
doc-complete
Matching PR in forked repository
PR in forked repository: x
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/OneWayReplicatorTest.java
Show resolved
Hide resolved
BewareMyPower
left a comment
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.
There is one point that is not explained by the comments.
If the test in #24583 (comment) is added based on commit 671994f (the latest commit before #24189), the test will pass.
But if the test is added to master branch, it will always fail.
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/OneWayReplicatorTest.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Yunze Xu
|
I got the reason now. After cluster A created a topic, the creation of the replicator producer will trigger the topic creation of cluster B. i.e. the following code has a great chance to fail: final String topic = "persistent://" + replicatedNamespace + "/topic";
admin1.topics().createNonPartitionedTopic(topic); Thread.sleep(1000); admin2.topics().createNonPartitionedTopic(topic); #24189 somehow speeds up the creation of the replication producer. BTW, I found the issue also from my improvements in topic loading. It should be the same reason. Regarding the following test: @TestQuestion 1: why removing
|
Codecov Report All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #24590 +/- ## ============================================ + Coverage 73.57% 74.29% +0.72% - Complexity 32624 33027 +403 ============================================ Files 1877 1880 +3 Lines 139502 146419 +6917 Branches 15299 16785 +1486 ============================================ + Hits 102638 108783 +6145 - Misses 28908 28995 +87 - Partials 7956 8641 +685
Flags with carried forward coverage won't be shown. Click here to find out more. New features to boost your workflow:
|
Co-authored-by: Yunze Xu
(cherry picked from commit 3ea8c26)
(cherry picked from commit ff86be1)
Co-authored-by: Yunze Xu
(cherry picked from commit 3ea8c26)
(cherry picked from commit ff86be1)
Co-authored-by: Yunze Xu
(cherry picked from commit 3ea8c26)
(cherry picked from commit b8670b5)
Co-authored-by: Yunze Xu
(cherry picked from commit 3ea8c26)
(cherry picked from commit b8670b5)