|
7 | 7 | import time |
8 | 8 | from contextlib import AsyncExitStack |
9 | 9 | 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) |
10 | 16 | from test_framework.blocktools import NULL_OUTPOINT |
11 | 17 | from test_framework.messages import ( |
12 | 18 | MAX_BLOCK_WEIGHT, |
@@ -325,7 +331,31 @@ async def async_routine(): |
325 | 331 | await mining.createNewBlock(ctx, opts) |
326 | 332 | raise AssertionError("createNewBlock unexpectedly succeeded") |
327 | 333 | except capnp.lib.capnp.KjException as e: |
| 334 | +<<<<<<< HEAD |
328 | 335 | 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) |
329 | 359 |
|
330 | 360 | asyncio.run(capnp.run(async_routine())) |
331 | 361 |
|
|
0 commit comments