Skip to content

fix: resolve flaky tests and move test constants out of production code#6553

Closed
vividctrlalt wants to merge 0 commit into
tronprotocol:developfrom
vividctrlalt:develop
Closed

fix: resolve flaky tests and move test constants out of production code#6553
vividctrlalt wants to merge 0 commit into
tronprotocol:developfrom
vividctrlalt:develop

Conversation

@vividctrlalt

Copy link
Copy Markdown
Contributor

Summary

  • Fix flaky BaseNetTest by adding null guards in destroy() and using random port for P2P listener to avoid port conflicts
  • Move test-only constant TEST_CONF from production Constant.java to new TestConstants.java in the test module
  • Rename TESTNET_CONF to NET_CONF for clarity since config.conf serves all network types

Changes

  • common/src/main/java/org/tron/core/Constant.java: Remove TEST_CONF, rename TESTNET_CONFNET_CONF
  • framework/src/test/java/org/tron/common/TestConstants.java: New test constants class
  • framework/src/test/java/org/tron/core/net/BaseNet.java: Add null guards in destroy(), use random port
  • 207 test files: Update Constant.TEST_CONFTestConstants.TEST_CONF
  • 4 production files: Update Constant.TESTNET_CONFConstant.NET_CONF

Test plan

  • Full test suite: 2271 tests passed (1 retried, 24 skipped), BUILD SUCCESSFUL
  • Representative tests verified: ArgsTest, ManagerTest, TransferActuatorTest, P2pEventHandlerImplTest, GlobalRateLimiterTest, SolidityNodeTest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant