Page MenuHomePhabricator

[electrum] fix the flaky reorg test
ClosedPublic

Authored by PiRK on Nov 23 2023, 21:18.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC31e9bcf108db: [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

Diff Detail

Event Timeline

PiRK requested review of this revision.Nov 23 2023, 21:18

nit (use COINBASE_MATURIY)

PiRK planned changes to this revision.Nov 23 2023, 21:26

This change seems to affect another test in rpc_misc

PiRK edited the summary of this revision. (Show Details)
PiRK edited the test plan for this revision. (Show Details)

rebase and add dependency on D14846, update the test plan to run the entire functional test suite to ensure this test is no longer breaking another test

This revision is now accepted and ready to land.Nov 24 2023, 09:51
This revision was automatically updated to reflect the committed changes.