Skip to content

Commit 4e0cec1

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 62f9599 commit 4e0cec1

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

test/functional/interface_ipc_mining.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
import time
88
from contextlib import AsyncExitStack
99
from io import BytesIO
10+
<<<<<<< HEAD
11+
||||||| parent of 0df79d4d12d (test: Updates needed after bitcoin-core/libmultiprocess#240)
12+
import re
13+
=======
14+
import platform
15+
>>>>>>> 0df79d4d12d (test: Updates needed after bitcoin-core/libmultiprocess#240)
1016
from test_framework.blocktools import NULL_OUTPOINT
1117
from test_framework.messages import (
1218
MAX_BLOCK_WEIGHT,
@@ -325,7 +331,31 @@ async def async_routine():
325331
await mining.createNewBlock(ctx, opts)
326332
raise AssertionError("createNewBlock unexpectedly succeeded")
327333
except capnp.lib.capnp.KjException as e:
334+
<<<<<<< HEAD
328335
assert_capnp_failed(e, "remote exception: std::exception: block_reserved_weight (0) must be at least 2000 weight units")
336+
||||||| parent of 0df79d4d12d (test: Updates needed after bitcoin-core/libmultiprocess#240)
337+
if e.type == "DISCONNECTED":
338+
# The remote exception isn't caught currently and leads to a
339+
# std::terminate call. Just detect and restart in this case.
340+
# This bug is fixed with
341+
# https://github.com/bitcoin-core/libmultiprocess/pull/218
342+
assert_equal(e.description, "Peer disconnected.")
343+
self.nodes[0].wait_until_stopped(expected_ret_code=(-11, -6, 1, 66), expected_stderr=re.compile(""))
344+
self.start_node(0)
345+
else:
346+
assert_equal(e.description, "remote exception: std::exception: block_reserved_weight (0) must be at least 2000 weight units")
347+
assert_equal(e.type, "FAILED")
348+
=======
349+
if e.description == "remote exception: unknown non-KJ exception of type: kj::Exception":
350+
# macOS + REDUCE_EXPORTS bug: Cap'n Proto fails to recognize
351+
# its own exception type and returns a generic error instead.
352+
# https://github.com/bitcoin/bitcoin/pull/34422#discussion_r2863852691
353+
# Assert this only occurs on Darwin until fixed.
354+
assert_equal(platform.system(), "Darwin")
355+
else:
356+
assert_equal(e.description, "remote exception: std::exception: block_reserved_weight (0) must be at least 2000 weight units")
357+
assert_equal(e.type, "FAILED")
358+
>>>>>>> 0df79d4d12d (test: Updates needed after bitcoin-core/libmultiprocess#240)
329359

330360
asyncio.run(capnp.run(async_routine()))
331361

0 commit comments

Comments
 (0)