mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-01 03:01:09 +02:00
Merge bitcoin/bitcoin#23300: test: Implicitly sync after generate*, unless opted out
facc352648
test: Implicitly sync after generate*, unless opted out (MarcoFalke) Pull request description: The most frequent failure in functional tests are intermittent races. Fixing such bugs is cumbersome because it involves: * Noticing the failure * Fetching and reading the log to determine the test case that failed * Adding a `self.sync_all()` where it was forgotten * Spamming out a pr and waiting for review, which is already sparse Also, writing a linter to catch those is not possible, nor is review effective in finding these bugs prior to merge. Fix all future intermittent races caused by a missing sync_block call by calling `sync_all` implicitly after each `generate*`, unless opted out. This ensures that the code is race-free (with regards to blocks) when the tests pass once, instead of our current approach where the code can never be guaranteed to be race-free. There are some scripted-diff cleanups (see https://github.com/bitcoin/bitcoin/pull/22567), but they will be submitted in a follow-up to reduce the conflicts in this pull. ACKs for top commit: lsilva01: tACKfacc352
on Ubuntu 20.04 brunoerg: tACKfacc352648
on MacOS 11.6 Tree-SHA512: 046a40a066b4a3bd28a3077bd654fa8887442dd1f0ec6fd11671865809ef02376f126eb667a1320ebd67b6e372c78c00dbf8bd25d86ed86f1d9a25363103ed97
This commit is contained in:
@ -1097,7 +1097,7 @@ class RawTransactionsTest(BitcoinTestFramework):
|
||||
# than any single input available, and require more than 1 input. So we make 3 outputs
|
||||
for i in range(0, 3):
|
||||
funds.sendtoaddress(tester.getnewaddress(address_type="bech32"), 1)
|
||||
self.generate(self.nodes[0], 1)
|
||||
self.generate(self.nodes[0], 1, sync_fun=self.no_op)
|
||||
|
||||
# Create transactions in order to calculate fees for the target bounds that can trigger this bug
|
||||
change_tx = tester.fundrawtransaction(tester.createrawtransaction([], [{funds.getnewaddress(): 1.5}]))
|
||||
|
Reference in New Issue
Block a user