HomePhabricator

[electrum] fix the flaky reorg test

Description

[electrum] fix the flaky reorg test

Summary:
The test was using a tx with a parent UTXO that was randomly chosen from a very limited set of 4 recently matured coinbase UTXOs, so the likelihood of making the parent UTXO immature by reorg-ing two blocks prior to the tx, making the tx itself invalid, was high (20%).

Fix this by making sure the parent tx UTXO always remains mature after the reorg.

Note that mining the additional 100 blocks and waiting for fulcrum and Electrum ABC to catch up only adds about 1 second to the test duration.

Depends on D14846

Test Plan: for i in {1..50}; do pytest electrumabc/tests/regtest/; done

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D14845

Details

Provenance
PiRKAuthored on Nov 23 2023, 20:55
PiRKPushed on Nov 24 2023, 10:06
Reviewer
Restricted Project
Differential Revision
D14845: [electrum] fix the flaky reorg test
Parents
rABCfe6fc6e235c5: [electrum] don't hardcode coinbase amount in test_balance
Branches
Unknown
Tags
Unknown