-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 RawReaderTest #21008
Conversation
pulsar-broker/src/test/java/org/apache/pulsar/client/impl/RawReaderTest.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #21008 +/- ##
=============================================
+ Coverage 33.56% 72.49% +38.92%
- Complexity 12198 32299 +20101
=============================================
Files 1621 1862 +241
Lines 126970 139445 +12475
Branches 13857 15379 +1522
=============================================
+ Hits 42618 101090 +58472
+ Misses 78748 30322 -48426
- Partials 5604 8033 +2429
Flags with carried forward coverage won't be shown. Click here to find out more.
|
while (true) { | ||
boolean hasMsg = reader.hasMessageAvailableAsync().get(); | ||
if (hasMsg && (messageCount == numKeys)) { | ||
Assert.fail("HasMessageAvailable shows still has message when there is no message"); | ||
error.set(true); |
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.
Why do you change this? If you are using the Atomicboolean, you need to break after the set. Otherwise, this test will be blocked at reader.readNextAsync().get()
because it shows there have messages but no message can be read.
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.
I will revert this when find the root cause.
@@ -321,7 +321,7 @@ public void testNegativeAcksDeleteFromUnackedTracker() throws Exception { | |||
negativeAcksTracker.close(); | |||
} | |||
|
|||
@Test(timeOut = 10000) | |||
@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.
Locally run takes about 8s sometimes, so remove this.
@@ -741,6 +741,7 @@ private void txnCumulativeAckTest(boolean batchEnable, int maxBatchSize, Subscri | |||
for (int i = 0; i < messageCnt; i++){ | |||
producer.newMessage().value("hello".getBytes()).sendAsync(); | |||
} | |||
producer.flush(); |
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.
@@ -529,7 +529,7 @@ protected void txnAckTest(boolean batchEnable, int maxBatchSize, | |||
// after transaction abort, the messages could be received | |||
Transaction commitTxn = getTxn(); | |||
for (int i = 0; i < messageCnt; i++) { | |||
message = consumer.receive(2, TimeUnit.SECONDS); | |||
message = consumer.receive(); |
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.
If the network is not good, here will fail. so no need to add timeout for this.
https://github.com/apache/pulsar/actions/runs/5899745435/job/16003227755?pr=21008
@@ -211,7 +211,7 @@ public void testReadMessageWithBatchingWithMessageInclusive() throws Exception { | |||
reader.close(); | |||
} | |||
|
|||
@Test(timeOut = 10000) | |||
@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.
Motivation
https://github.com/apache/pulsar/actions/runs/5877094886/job/15945999791?pr=20990
Documentation
doc
doc-required
doc-not-needed
doc-complete