Skip to content

Commit 0df79d4

Browse files
committed
test: Updates needed after bitcoin-core/libmultiprocess#240
Upstream PR bitcoin-core/libmultiprocess#240 fixed various issues which require updates to python IPC tests. Those changes are made in this commit.
1 parent a9128aa commit 0df79d4

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

test/functional/interface_ipc_mining.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import time
88
from contextlib import AsyncExitStack
99
from io import BytesIO
10-
import re
10+
import platform
1111
from test_framework.blocktools import NULL_OUTPOINT
1212
from test_framework.messages import (
1313
MAX_BLOCK_WEIGHT,
@@ -313,17 +313,15 @@ async def async_routine():
313313
await mining.createNewBlock(ctx, opts)
314314
raise AssertionError("createNewBlock unexpectedly succeeded")
315315
except capnp.lib.capnp.KjException as e:
316-
if e.type == "DISCONNECTED":
317-
# The remote exception isn't caught currently and leads to a
318-
# std::terminate call. Just detect and restart in this case.
319-
# This bug is fixed with
320-
# https://github.com/bitcoin-core/libmultiprocess/pull/218
321-
assert_equal(e.description, "Peer disconnected.")
322-
self.nodes[0].wait_until_stopped(expected_ret_code=(-11, -6, 1, 66), expected_stderr=re.compile(""))
323-
self.start_node(0)
316+
if e.description == "remote exception: unknown non-KJ exception of type: kj::Exception":
317+
# macOS + REDUCE_EXPORTS bug: Cap'n Proto fails to recognize
318+
# its own exception type and returns a generic error instead.
319+
# https://github.com/bitcoin/bitcoin/pull/34422#discussion_r2863852691
320+
# Assert this only occurs on Darwin until fixed.
321+
assert_equal(platform.system(), "Darwin")
324322
else:
325323
assert_equal(e.description, "remote exception: std::exception: block_reserved_weight (0) must be at least 2000 weight units")
326-
assert_equal(e.type, "FAILED")
324+
assert_equal(e.type, "FAILED")
327325

328326
asyncio.run(capnp.run(async_routine()))
329327

0 commit comments

Comments
 (0)