diff --git a/test/functional/interface_ipc_mining.py b/test/functional/interface_ipc_mining.py index 61c050e74fe..d4a0d87e767 100755 --- a/test/functional/interface_ipc_mining.py +++ b/test/functional/interface_ipc_mining.py @@ -6,6 +6,7 @@ import asyncio from contextlib import AsyncExitStack from io import BytesIO +import re from test_framework.blocktools import NULL_OUTPOINT from test_framework.messages import ( MAX_BLOCK_WEIGHT, @@ -257,12 +258,21 @@ class IPCMiningTest(BitcoinTestFramework): empty_block = await mining_get_block(empty_template, ctx) assert_equal(len(empty_block.vtx), 1) - self.log.debug("Enforce minimum reserved weight for IPC clients too") - opts.blockReservedWeight = 0 - try: - await mining.createNewBlock(opts) - raise AssertionError("createNewBlock unexpectedly succeeded") - except capnp.lib.capnp.KjException as e: + self.log.debug("Enforce minimum reserved weight for IPC clients too") + opts.blockReservedWeight = 0 + try: + await mining.createNewBlock(opts) + raise AssertionError("createNewBlock unexpectedly succeeded") + except capnp.lib.capnp.KjException as e: + if e.type == "DISCONNECTED": + # The remote exception isn't caught currently and leads to a + # std::terminate call. Just detect and restart in this case. + # This bug is fixed with + # https://github.com/bitcoin-core/libmultiprocess/pull/218 + assert_equal(e.description, "Peer disconnected.") + self.nodes[0].wait_until_stopped(expected_ret_code=(-11, -6, 1, 66), expected_stderr=re.compile("")) + self.start_node(0) + else: assert_equal(e.description, "remote exception: std::exception: block_reserved_weight (0) must be at least 2000 weight units") assert_equal(e.type, "FAILED")