-
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
Add null check to workaround NPE in unit tests with Mockito/PowerMock #14006
Conversation
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
Show resolved
Hide resolved
@lhotari:Thanks for your contribution. For this PR, do we need to update docs? |
@lhotari:Thanks for providing doc info! |
I believe this would also fix #13808. |
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
Show resolved
Hide resolved
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.
LGTM. If/when we remove the mocking that is responsible for these flaky tests, it'd be good to revert this change.
Motivation
Workaround for a NPE issue that happens with Mockito/PowerMock:
Modification
Add a null check to prevent the NPE.