Skip to content

Conversation

@317787106
Copy link
Contributor

@317787106 317787106 commented Nov 25, 2025

What does this PR do?

  • remove peer from PeerManager after testcase, fix RpcApiServicesTest.testGetNodeInfo
  • add log when receives keep alive message in BackupManager to help for debug
  • check if tronNetDelegate is 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:

  • Unit Tests
  • Manual Testing

Follow up

Extra details

@317787106 317787106 changed the title hotfix(testcase): remove peer from PeerManager after testcase fix(testcase): remove peer from PeerManager after testcase Nov 25, 2025
public void clearPeers() {
for (PeerConnection p : PeerManager.getPeers()) {
PeerManager.remove(p.getChannel());
}
Copy link
Contributor

Choose a reason for hiding this comment

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

add Args.clearParam(); ?

Copy link
Contributor Author

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);

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?

Copy link
Contributor Author

@317787106 317787106 Nov 27, 2025

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

@kuny0707 kuny0707 merged commit 0779184 into tronprotocol:release_v4.8.1 Nov 27, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants