mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
Merge bitcoin/bitcoin#32069: test: fix intermittent failure in wallet_reorgsrestore.py
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / macOS 14 native, arm64, fuzz (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run
CI / Win64 native fuzz, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / macOS 14 native, arm64, fuzz (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run
CI / Win64 native fuzz, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
36b0713edc
test: fix intermittent failure in wallet_reorgsrestore.py (furszy) Pull request description: In response to #32066 intermittent failure. Wait until the node's process has fully stopped before starting a new instance of it. Same behavior as in the [tool_wallet.py](698f86964c/test/functional/tool_wallet.py (L540)
) test. ACKs for top commit: maflcko: lgtm ACK36b0713edc
Chand-ra: tACK [36b0713
](36b0713edc
) Tree-SHA512: 8e01493ef1fb58589479f3e12d7429d02ca75a2183d5f79d3b6a2fbf13334878926274a20857f1b4729afc1d30b65789daed229ce06ba236b91d949b73f45d5a
This commit is contained in:
commit
cd8089c20b
3 changed files with 7 additions and 5 deletions
|
@ -443,6 +443,11 @@ class TestNode():
|
||||||
kwargs["expected_ret_code"] = 1 if expect_error else 0 # Whether node shutdown return EXIT_FAILURE or EXIT_SUCCESS
|
kwargs["expected_ret_code"] = 1 if expect_error else 0 # Whether node shutdown return EXIT_FAILURE or EXIT_SUCCESS
|
||||||
self.wait_until(lambda: self.is_node_stopped(**kwargs), timeout=timeout)
|
self.wait_until(lambda: self.is_node_stopped(**kwargs), timeout=timeout)
|
||||||
|
|
||||||
|
def kill_process(self):
|
||||||
|
self.process.kill()
|
||||||
|
self.wait_until_stopped(expected_ret_code=1 if platform.system() == "Windows" else -9)
|
||||||
|
assert self.is_node_stopped()
|
||||||
|
|
||||||
def replace_in_config(self, replacements):
|
def replace_in_config(self, replacements):
|
||||||
"""
|
"""
|
||||||
Perform replacements in the configuration file.
|
Perform replacements in the configuration file.
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
"""Test bitcoin-wallet."""
|
"""Test bitcoin-wallet."""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import platform
|
|
||||||
import random
|
import random
|
||||||
import stat
|
import stat
|
||||||
import string
|
import string
|
||||||
|
@ -536,9 +535,7 @@ class ToolWalletTest(BitcoinTestFramework):
|
||||||
# Next cause a bunch of writes by filling the keypool
|
# Next cause a bunch of writes by filling the keypool
|
||||||
wallet.keypoolrefill(wallet.getwalletinfo()["keypoolsize"] + 100)
|
wallet.keypoolrefill(wallet.getwalletinfo()["keypoolsize"] + 100)
|
||||||
# Lastly kill bitcoind so that the LSNs don't get reset
|
# Lastly kill bitcoind so that the LSNs don't get reset
|
||||||
self.nodes[0].process.kill()
|
self.nodes[0].kill_process()
|
||||||
self.nodes[0].wait_until_stopped(expected_ret_code=1 if platform.system() == "Windows" else -9)
|
|
||||||
assert self.nodes[0].is_node_stopped()
|
|
||||||
|
|
||||||
wallet_dump = self.nodes[0].datadir_path / "unclean_lsn.dump"
|
wallet_dump = self.nodes[0].datadir_path / "unclean_lsn.dump"
|
||||||
self.assert_raises_tool_error("LSNs are not reset, this database is not completely flushed. Please reopen then close the database with a version that has BDB support", "-wallet=unclean_lsn", f"-dumpfile={wallet_dump}", "dump")
|
self.assert_raises_tool_error("LSNs are not reset, this database is not completely flushed. Please reopen then close the database with a version that has BDB support", "-wallet=unclean_lsn", f"-dumpfile={wallet_dump}", "dump")
|
||||||
|
|
|
@ -115,7 +115,7 @@ class ReorgsRestoreTest(BitcoinTestFramework):
|
||||||
assert_equal(wallet.gettransaction(coinbase_tx_id)['details'][0]['abandoned'], True)
|
assert_equal(wallet.gettransaction(coinbase_tx_id)['details'][0]['abandoned'], True)
|
||||||
|
|
||||||
# Abort process abruptly to mimic an unclean shutdown (no chain state flush to disk)
|
# Abort process abruptly to mimic an unclean shutdown (no chain state flush to disk)
|
||||||
node.process.kill()
|
node.kill_process()
|
||||||
|
|
||||||
# Restart the node and confirm that it has not persisted the last chain state changes to disk
|
# Restart the node and confirm that it has not persisted the last chain state changes to disk
|
||||||
self.start_node(0)
|
self.start_node(0)
|
||||||
|
|
Loading…
Add table
Reference in a new issue