Repository navigation
[fix][test] Fix clear transaction buffer snapshot flaky test - #14922
Merged
congbobo184 merged 1 commit intoApr 14, 2022
Merged
congbobo184 merged 1 commit into
congbobo184 merged 1 commit into
Conversation
|
@Demogorgon314:Thanks for your contribution. For this PR, do we need to update docs? |
Member
Author
|
/pulsarbot rerun-failure-checks |
|
@Demogorgon314:Thanks for providing doc info! |
Member
Author
|
/pulsarbot rerun-failure-checks |
Technoboy-
approved these changes
Mar 29, 2022
Demogorgon314
force-pushed
the
fix/transaction-buffer-snapshot-test-flaky-test
branch
from
March 31, 2022 01:19
0b73840 to
a62fadd
Compare
Demogorgon314
force-pushed
the
fix/transaction-buffer-snapshot-test-flaky-test
branch
from
April 1, 2022 04:59
a62fadd to
902d57d
Compare
Member
Author
|
@codelipenghui @BewareMyPower The CI is passed. Please take a look if you have time, thanks : ) |
Jason918
approved these changes
Apr 7, 2022
congbobo184
approved these changes
Apr 14, 2022
aparajita89
pushed a commit
to aparajita89/pulsar
that referenced
this pull request
Apr 18, 2022
### Motivation ``` java.lang.AssertionError: Expected :true Actual :false <Click to see difference> at org.testng.Assert.fail(Assert.java:99) at org.testng.Assert.failNotEquals(Assert.java:1037) at org.testng.Assert.assertTrue(Assert.java:45) at org.testng.Assert.assertTrue(Assert.java:55) at org.apache.pulsar.broker.transaction.TopicTransactionBufferRecoverTest.checkSnapshotCount(TopicTransactionBufferRecoverTest.java:452) at org.apache.pulsar.broker.transaction.TopicTransactionBufferRecoverTest.clearTransactionBufferSnapshotTest(TopicTransactionBufferRecoverTest.java:427) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:132) // ... ``` Currently, the clear transaction buffer snapshot is flaky, because we used `@Cleanup` annotation, the `@Cleanup` annotation will put the close producer method to the bottom of the test method, then the producer will close after deleting the topic. When we delete the topic, all relevant producers will receive a `CLOSE_PRODUCER` command, then the producer client will try to reconnect to the broker, so it will send the `PRODUCER` command again, then the transaction buffer snapshot will take a new snapshot, so the test will fail. ### Modifications Make the producer close before the topic deleting.
Nicklee007
pushed a commit
to Nicklee007/pulsar
that referenced
this pull request
Apr 20, 2022
### Motivation ``` java.lang.AssertionError: Expected :true Actual :false <Click to see difference> at org.testng.Assert.fail(Assert.java:99) at org.testng.Assert.failNotEquals(Assert.java:1037) at org.testng.Assert.assertTrue(Assert.java:45) at org.testng.Assert.assertTrue(Assert.java:55) at org.apache.pulsar.broker.transaction.TopicTransactionBufferRecoverTest.checkSnapshotCount(TopicTransactionBufferRecoverTest.java:452) at org.apache.pulsar.broker.transaction.TopicTransactionBufferRecoverTest.clearTransactionBufferSnapshotTest(TopicTransactionBufferRecoverTest.java:427) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:132) // ... ``` Currently, the clear transaction buffer snapshot is flaky, because we used `@Cleanup` annotation, the `@Cleanup` annotation will put the close producer method to the bottom of the test method, then the producer will close after deleting the topic. When we delete the topic, all relevant producers will receive a `CLOSE_PRODUCER` command, then the producer client will try to reconnect to the broker, so it will send the `PRODUCER` command again, then the transaction buffer snapshot will take a new snapshot, so the test will fail. ### Modifications Make the producer close before the topic deleting.
nicoloboschi
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 9, 2022
### Motivation ``` java.lang.AssertionError: Expected :true Actual :false <Click to see difference> at org.testng.Assert.fail(Assert.java:99) at org.testng.Assert.failNotEquals(Assert.java:1037) at org.testng.Assert.assertTrue(Assert.java:45) at org.testng.Assert.assertTrue(Assert.java:55) at org.apache.pulsar.broker.transaction.TopicTransactionBufferRecoverTest.checkSnapshotCount(TopicTransactionBufferRecoverTest.java:452) at org.apache.pulsar.broker.transaction.TopicTransactionBufferRecoverTest.clearTransactionBufferSnapshotTest(TopicTransactionBufferRecoverTest.java:427) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:132) // ... ``` Currently, the clear transaction buffer snapshot is flaky, because we used `@Cleanup` annotation, the `@Cleanup` annotation will put the close producer method to the bottom of the test method, then the producer will close after deleting the topic. When we delete the topic, all relevant producers will receive a `CLOSE_PRODUCER` command, then the producer client will try to reconnect to the broker, so it will send the `PRODUCER` command again, then the transaction buffer snapshot will take a new snapshot, so the test will fail. ### Modifications Make the producer close before the topic deleting. (cherry picked from commit 4ad8b5b)
nicoloboschi
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 9, 2022
### Motivation ``` java.lang.AssertionError: Expected :true Actual :false <Click to see difference> at org.testng.Assert.fail(Assert.java:99) at org.testng.Assert.failNotEquals(Assert.java:1037) at org.testng.Assert.assertTrue(Assert.java:45) at org.testng.Assert.assertTrue(Assert.java:55) at org.apache.pulsar.broker.transaction.TopicTransactionBufferRecoverTest.checkSnapshotCount(TopicTransactionBufferRecoverTest.java:452) at org.apache.pulsar.broker.transaction.TopicTransactionBufferRecoverTest.clearTransactionBufferSnapshotTest(TopicTransactionBufferRecoverTest.java:427) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:132) // ... ``` Currently, the clear transaction buffer snapshot is flaky, because we used `@Cleanup` annotation, the `@Cleanup` annotation will put the close producer method to the bottom of the test method, then the producer will close after deleting the topic. When we delete the topic, all relevant producers will receive a `CLOSE_PRODUCER` command, then the producer client will try to reconnect to the broker, so it will send the `PRODUCER` command again, then the transaction buffer snapshot will take a new snapshot, so the test will fail. ### Modifications Make the producer close before the topic deleting. (cherry picked from commit 4ad8b5b)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Currently, the clear transaction buffer snapshot is flaky, because we used
@Cleanupannotation, the@Cleanupannotation will put the close producer method to the bottom of the test method, then the producer will close after deleting the topic.When we delete the topic, all relevant producers will receive a
CLOSE_PRODUCERcommand, then the producer client will try to reconnect to the broker, so it will send thePRODUCERcommand again, then the transaction buffer snapshot will take a new snapshot, so the test will fail.Modifications
Make the producer close before the topic deleting.
Documentation
Check the box below or label this PR directly (if you have committer privilege).
Need to update docs?
doc-required(If you need help on updating docs, create a doc issue)
no-need-doc(Please explain why)
doc(If this PR contains doc changes)