Skip to content

Fix bootstrap unit tests#4383

Merged
dsiganos merged 37 commits intonanocurrency:developfrom
dsiganos:fix_bootstrap_unit_tests
Jan 26, 2024
Merged

Fix bootstrap unit tests#4383
dsiganos merged 37 commits intonanocurrency:developfrom
dsiganos:fix_bootstrap_unit_tests

Conversation

@dsiganos
Copy link
Copy Markdown
Contributor

@dsiganos dsiganos commented Jan 21, 2024

This fixes a number of issues with the bootstrap tests.
This work was triggered by #4368, which was flawed.

A common mistake that I have seen before is to convert manually created instances of nano::node (without using system.add_node). Often people assume that this is just old code and that the manual construction of the object can be tidied up by the add_node call. But in many cases these manual node constructions are there so that the node is not connected to anything, add_node runs code to connect all nodes in a system.

Many tests depended on or simply called block_processor.flush(). I removed all instances of block processor flush as it shouldn't be needed and is known to be buggy.

Some tests were supposedly disabling the legacy bootstrap and testing the lazy bootstrap. But since we now have ascending bootstrap, these tests had to modified to disable the ascending bootstrap too.

Many tests were setting the network port semi-automatically but there is no need to do so, it is more flexible to let the OS pick a port number.

I re-enabled some tests that were disabled due to failing intermittedly.

resolves #3559
resolves #3517
resolves #3640
resolves #3613

@dsiganos dsiganos added unit test Related to a new, changed or fixed unit test exclude from changelog Indicates the change is not relevant for appearing in the release changelog labels Jan 21, 2024
@dsiganos dsiganos force-pushed the fix_bootstrap_unit_tests branch from d47ce4b to a2bc018 Compare January 25, 2024 18:02
clemahieu
clemahieu previously approved these changes Jan 26, 2024
@dsiganos dsiganos force-pushed the fix_bootstrap_unit_tests branch from 862e39c to 91dfe35 Compare January 26, 2024 06:53
@dsiganos dsiganos merged commit efe41ee into nanocurrency:develop Jan 26, 2024
@dsiganos dsiganos deleted the fix_bootstrap_unit_tests branch January 26, 2024 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exclude from changelog Indicates the change is not relevant for appearing in the release changelog unit test Related to a new, changed or fixed unit test

Projects

None yet

3 participants