Upstream PR bitcoin-core/libmultiprocess#240 fixed various issues which require
updates to python IPC tests. Those changes are made in this commit.
This commit is contained in:
Ryan Ofsky
2026-01-20 23:36:00 -05:00
parent cb15f5a317
commit 8fe91f3719
2 changed files with 25 additions and 36 deletions

View File

@@ -6,7 +6,7 @@
import asyncio
from contextlib import AsyncExitStack
from io import BytesIO
import re
import platform
from test_framework.blocktools import NULL_OUTPOINT
from test_framework.messages import (
MAX_BLOCK_WEIGHT,
@@ -245,17 +245,15 @@ class IPCMiningTest(BitcoinTestFramework):
await mining.createNewBlock(ctx, 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)
if e.description == "remote exception: unknown non-KJ exception of type: kj::Exception":
# macOS + REDUCE_EXPORTS bug: Cap'n Proto fails to recognize
# its own exception type and returns a generic error instead.
# https://github.com/bitcoin/bitcoin/pull/34422#discussion_r2863852691
# Assert this only occurs on Darwin until fixed.
assert_equal(platform.system(), "Darwin")
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")
assert_equal(e.type, "FAILED")
asyncio.run(capnp.run(async_routine()))