-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix(testcase): remove peer from PeerManager after testcase #6486
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
fix(testcase): remove peer from PeerManager after testcase #6486
Conversation
| public void clearPeers() { | ||
| for (PeerConnection p : PeerManager.getPeers()) { | ||
| PeerManager.remove(p.getChannel()); | ||
| } |
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.
add Args.clearParam(); ?
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.
This testcase has extended BaseTest which implements Args.clearParam() in @afterclass method.
| return; | ||
| } | ||
|
|
||
| logger.info("Receive keep alive message from {}", sender); |
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.
Maybe it should be sender.getHostString() to keep consistency with lines 121 and 126?
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.
Actually, it's more accurate to logging InetSocketAddress, the style is /IP:port. Line 126 only needs IP
What does this PR do?
BackupManagerto help for debugtronNetDelegateis null in PeerStatusCheck to fix NullPointerException when use mock in several testcases, such as org.tron.core.net.peer.PeerStatusCheckMockTest. NullPointerException occurs only in mock test.Why are these changes required?
This PR has been tested by:
Follow up
Extra details