Skip to content

[Tests] Fix flakiness issue when spying ServerCnx - #13608

Merged
lhotari merged 1 commit into
apache:masterfrom
lhotari:lh-fix-flaky-ServerCnx-spy
Jan 4, 2022
Merged

lhotari merged 1 commit into
apache:masterfrom
lhotari:lh-fix-flaky-ServerCnx-spy

Conversation

@lhotari

@lhotari lhotari commented Jan 4, 2022

Copy link
Copy Markdown
Member

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