Fix rpc.block_count_pruning test flakiness#5012
Fix rpc.block_count_pruning test flakiness#5012pwojcikdev merged 1 commit intonanocurrency:developfrom
rpc.block_count_pruning test flakiness#5012Conversation
Test Results for Commit 20af3a2Pull Request 5012: Results Test Case Results
Last updated: 2026-01-26 15:31:36 UTC |
There was a problem hiding this comment.
Pull request overview
This PR fixes a flaky test in the RPC test suite by preventing node0 from auto-receiving a send block that would create a fork with the manually processed receive block.
Changes:
- Configures node0 with a high
receive_minimumthreshold to disable auto-receive behavior in theblock_count_pruningtest
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| nano::node_config node_config0 = system.default_config (); | ||
| node_config0.receive_minimum = nano::dev::constants.genesis_amount; // Prevent auto-receive & receive1 block conflicts | ||
| auto & node0 = *system.add_node (node_config0); | ||
| nano::node_config node_config = system.default_config (); |
There was a problem hiding this comment.
The variable name node_config is used for the second node's configuration (line 2288), while node_config0 is used for the first node. For consistency and clarity, consider renaming node_config to node_config1 to match the pattern where node0 uses node_config0 and node1 uses node_config1. This would make it clearer which configuration belongs to which node.
The test was failing because node0 would auto-receive the send block, creating a fork with the receive1 block that node1 processes locally. With two competing receive blocks, elections couldn't reach consensus.