|
7 | 7 | import time |
8 | 8 | from contextlib import AsyncExitStack |
9 | 9 | from io import BytesIO |
10 | | -import re |
| 10 | +import platform |
11 | 11 | from test_framework.blocktools import NULL_OUTPOINT |
12 | 12 | from test_framework.messages import ( |
13 | 13 | MAX_BLOCK_WEIGHT, |
@@ -313,17 +313,15 @@ async def async_routine(): |
313 | 313 | await mining.createNewBlock(ctx, opts) |
314 | 314 | raise AssertionError("createNewBlock unexpectedly succeeded") |
315 | 315 | 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") |
324 | 322 | else: |
325 | 323 | 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") |
327 | 325 |
|
328 | 326 | asyncio.run(capnp.run(async_routine())) |
329 | 327 |
|
|
0 commit comments