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

[Tests] Fix flakiness issue when spying ServerCnx #13608

Merged
merged 1 commit into from
Jan 4, 2022

Conversation

lhotari
Copy link
Member

@lhotari lhotari commented Jan 4, 2022

Fixes #13570

Motivation

For some reason spy(new ServerCnx(pulsar)) is flaky and fails with NPE in the ServerCnx constructor. The full stacktrace can be seen in #13570 description.

Modifications

The alternative solution is to use mock(ServerCnx.class, withSettings() .useConstructor(pulsar) .defaultAnswer(CALLS_REAL_METHODS)) and the expectation is that the NPE wouldn't occur in this case.

@lhotari lhotari added type/flaky-tests doc-not-needed Your PR changes do not impact docs labels Jan 4, 2022
@lhotari lhotari self-assigned this Jan 4, 2022
@lhotari lhotari merged commit de99c2c into apache:master Jan 4, 2022
wuzhanpeng pushed a commit to wuzhanpeng/pulsar that referenced this pull request Jan 5, 2022
@lhotari lhotari added this to the 2.10.0 milestone Jan 5, 2022
codelipenghui pushed a commit that referenced this pull request Jan 6, 2022
@codelipenghui codelipenghui added the cherry-picked/branch-2.8 Archived: 2.8 is end of life label Jan 6, 2022
codelipenghui pushed a commit that referenced this pull request Jan 10, 2022
@codelipenghui codelipenghui added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/test cherry-picked/branch-2.8 Archived: 2.8 is end of life cherry-picked/branch-2.9 Archived: 2.9 is end of life doc-not-needed Your PR changes do not impact docs release/2.8.3 release/2.9.2 type/flaky-tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flaky-test: PersistentTopicTest.setup
5 participants