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][flaky-test]Fix flaky test in PulsarSinkE2ETest.testPulsarSinkDLQ #16799

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ public void testPulsarSinkDLQ() throws Exception {
remainingMessagesToReceive.add(messageBody);
}

// Wait all msg show in dlqTopic.
Awaitility.await().untilAsserted(()-> {
assertEquals(admin.topics().getLastMessageId(dlqTopic).toString(),"10:1:-1:8");
Copy link
Member

Choose a reason for hiding this comment

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

Can we guarantee that the message-id is the same for every testing? There is an exception in this PR:https://github.com/apache/pulsar/runs/7524494144?check_suite_focus=true#step:10:1231

We can directly modify the wait time for the consumer to receive the message:
https://github.com/apache/pulsar/pull/16799/files#diff-1be1a68c630a114a3f7770115053f58066cbf117b24d0e73903f6340f7aef793L194

And I think the root cause may not be the timeout setting. 10 seconds should be enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can we guarantee that the message-id is the same for every testing? There is an exception in this

seems that you are right

});

//4 All messages should enter DLQ
for (int i = 0; i < totalMsgs; i++) {
Message<String> message = consumer.receive(10, TimeUnit.SECONDS);
Expand Down