Skip to content

[ Issue 11032 ] Fixed flaky test ZKSessionTest.. #11032 - #11062

Merged
sijie merged 5 commits into
apache:masterfrom
mattisonchao:fixed_flaky_test__11032
Jul 14, 2021
Merged

[ Issue 11032 ] Fixed flaky test ZKSessionTest.. #11032#11062
sijie merged 5 commits into
apache:masterfrom
mattisonchao:fixed_flaky_test__11032

Conversation

@mattisonchao

@mattisonchao mattisonchao commented Jun 24, 2021

Copy link
Copy Markdown
Member

Fixes #11032 #11143

Master Issue: #11032 #11143

Motivation
In some cases, testing errors occurred due to Zookeeper's notification delay.

Modifications
Waiting async notice until timeout.

In some cases, testing errors occurred due to Zookeeper's notification delay.

- Waiting async notice until timeout.
@sijie sijie added this to the 2.9.0 milestone Jun 24, 2021
@mattisonchao

Copy link
Copy Markdown
Member Author

/pulsarbot rerun-failure-checks

@eolivelli eolivelli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thank you for helping with this fix.

overall LGTM

but can you please take a look to my comments ?

Comment thread pulsar-metadata/src/test/java/org/apache/pulsar/metadata/ZKSessionTest.java Outdated
Comment thread pulsar-metadata/src/test/java/org/apache/pulsar/metadata/ZKSessionTest.java Outdated
Comment thread pulsar-metadata/src/test/java/org/apache/pulsar/metadata/ZKSessionTest.java Outdated
Firstly,This test to validate leader election after session is recovered.
I think the leaderElectionEvenets check is unstable in here.
eg:
1.When the node state is late to update => node state = Leading, leaderElectionEvents is empty.
2.When a node has been elected as the leader => node sate = Leading, leaderElectionEvents = [noLeader,Leading/Following].
3.Leader election may be triggered at any time.(It may be just after the election due to network delays).

- Delete leaderElectionEvents null check.
- Waiting for node can be leader after session expire.
@mattisonchao

Copy link
Copy Markdown
Member Author

Firstly, This test validates leader election after the session is recovered.
I think the leaderElectionEvenets check is unstable here.
eg:
1.When the node state is late to update => node state = Leading, leaderElectionEvents is empty.
2.When a node has been elected as the leader => node sate = Leading, leaderElectionEvents = [noLeader,Leading/Following].
3.Leader election may be triggered at any time. (It may be just after the election due to network delays).

@mattisonchao

Copy link
Copy Markdown
Member Author

If I understand it wrong, please give me some guidance. @315157973 @lhotari @eolivelli

…ilover (#10786)

Replaced check after sleep to `untilAsserted` and extended `atMost` time
to 10 seconds(default of `Awaitility`).
Comment thread pulsar-metadata/src/test/java/org/apache/pulsar/metadata/ZKSessionTest.java Outdated
@mattisonchao

Copy link
Copy Markdown
Member Author

@eolivelli Could you review again?

@mattisonchao
mattisonchao requested a review from eolivelli June 29, 2021 07:10
@eolivelli

Copy link
Copy Markdown
Contributor

please @315157973 take another look

@mattisonchao

Copy link
Copy Markdown
Member Author

@315157973 PTAL

@sijie
sijie merged commit 96b91f8 into apache:master Jul 14, 2021
bharanic-dev pushed a commit to bharanic-dev/pulsar that referenced this pull request Mar 18, 2022
…#11062)

Fixes apache#11032 apache#11143

Master Issue: apache#11032 apache#11143

Motivation
In some cases, testing errors occurred due to Zookeeper's notification delay.

Modifications
Waiting async notice until timeout.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky-test: ZKSessionTest.testReacquireLeadershipAfterSessionLost

5 participants