Page MenuHomePhabricator

[avalanche] Fix stake contender unit test occasional failure
ClosedPublic

Authored by Fabien on Fri, Apr 18, 14:45.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABCdc7fa3c5d71e: [avalanche] Fix stake contender unit test occasional failure
Summary

The sorting algo differs in the test from the node algo if the number of accepted contenders is > AVALANCHE_CONTENDER_MAX_POLLABLE, which is a rare event.

To reproduce you can reduce AVALANCHE_CONTENDER_MAX_POLLABLE to some small number (4 is a good value) and run the test in a loop, it should fail quickly without this patch.

Test Plan
for i in {1..100}; do echo "Trial $i" && ./src/avalanche/test/test-avalanche -t processor_tests/stake_contender_local_winners || break; done

Diff Detail