From b875b35b984fae8e3ca79613f81d94cf057a5fea Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 9 Dec 2024 16:08:55 -0500 Subject: [PATCH] Change `tractor.breakpoint()` to new `.pause()` in test suite --- examples/debugging/fast_error_in_root_after_spawn.py | 2 +- examples/debugging/multi_daemon_subactors.py | 2 +- .../multi_nested_subactors_error_up_through_nurseries.py | 2 +- examples/debugging/multi_subactors.py | 2 +- examples/debugging/root_actor_breakpoint.py | 2 +- examples/debugging/root_actor_breakpoint_forever.py | 2 +- examples/debugging/subactor_bp_in_ctx.py | 6 +++--- tests/test_context_stream_semantics.py | 2 +- tests/test_task_broadcasting.py | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/debugging/fast_error_in_root_after_spawn.py b/examples/debugging/fast_error_in_root_after_spawn.py index 570cf7e..8671078 100644 --- a/examples/debugging/fast_error_in_root_after_spawn.py +++ b/examples/debugging/fast_error_in_root_after_spawn.py @@ -1,5 +1,5 @@ ''' -Fast fail test with a context. +Fast fail test with a `Context`. Ensure the partially initialized sub-actor process doesn't cause a hang on error/cancel of the parent diff --git a/examples/debugging/multi_daemon_subactors.py b/examples/debugging/multi_daemon_subactors.py index 4a46262..7844cce 100644 --- a/examples/debugging/multi_daemon_subactors.py +++ b/examples/debugging/multi_daemon_subactors.py @@ -7,7 +7,7 @@ async def breakpoint_forever(): try: while True: yield 'yo' - await tractor.breakpoint() + await tractor.pause() except BaseException: tractor.log.get_console_log().exception( 'Cancelled while trying to enter pause point!' diff --git a/examples/debugging/multi_nested_subactors_error_up_through_nurseries.py b/examples/debugging/multi_nested_subactors_error_up_through_nurseries.py index 8df52e3..b63f194 100644 --- a/examples/debugging/multi_nested_subactors_error_up_through_nurseries.py +++ b/examples/debugging/multi_nested_subactors_error_up_through_nurseries.py @@ -10,7 +10,7 @@ async def name_error(): async def breakpoint_forever(): "Indefinitely re-enter debugger in child actor." while True: - await tractor.breakpoint() + await tractor.pause() # NOTE: if the test never sent 'q'/'quit' commands # on the pdb repl, without this checkpoint line the diff --git a/examples/debugging/multi_subactors.py b/examples/debugging/multi_subactors.py index 22b13ac..57634cc 100644 --- a/examples/debugging/multi_subactors.py +++ b/examples/debugging/multi_subactors.py @@ -6,7 +6,7 @@ async def breakpoint_forever(): "Indefinitely re-enter debugger in child actor." while True: await trio.sleep(0.1) - await tractor.breakpoint() + await tractor.pause() async def name_error(): diff --git a/examples/debugging/root_actor_breakpoint.py b/examples/debugging/root_actor_breakpoint.py index 5c858d4..55b4ca5 100644 --- a/examples/debugging/root_actor_breakpoint.py +++ b/examples/debugging/root_actor_breakpoint.py @@ -10,7 +10,7 @@ async def main(): await trio.sleep(0.1) - await tractor.breakpoint() + await tractor.pause() await trio.sleep(0.1) diff --git a/examples/debugging/root_actor_breakpoint_forever.py b/examples/debugging/root_actor_breakpoint_forever.py index 88a6e0e..04cd7e7 100644 --- a/examples/debugging/root_actor_breakpoint_forever.py +++ b/examples/debugging/root_actor_breakpoint_forever.py @@ -11,7 +11,7 @@ async def main( # loglevel='runtime', ): while True: - await tractor.breakpoint() + await tractor.pause() if __name__ == '__main__': diff --git a/examples/debugging/subactor_bp_in_ctx.py b/examples/debugging/subactor_bp_in_ctx.py index a47dbd9..2c5fee8 100644 --- a/examples/debugging/subactor_bp_in_ctx.py +++ b/examples/debugging/subactor_bp_in_ctx.py @@ -4,9 +4,9 @@ import trio async def gen(): yield 'yo' - await tractor.breakpoint() + await tractor.pause() yield 'yo' - await tractor.breakpoint() + await tractor.pause() @tractor.context @@ -15,7 +15,7 @@ async def just_bp( ) -> None: await ctx.started() - await tractor.breakpoint() + await tractor.pause() # TODO: bps and errors in this call.. async for val in gen(): diff --git a/tests/test_context_stream_semantics.py b/tests/test_context_stream_semantics.py index 8edea51..ade275a 100644 --- a/tests/test_context_stream_semantics.py +++ b/tests/test_context_stream_semantics.py @@ -955,7 +955,7 @@ async def echo_back_sequence( ) await ctx.started() - # await tractor.breakpoint() + # await tractor.pause() async with ctx.open_stream( msg_buffer_size=msg_buffer_size, diff --git a/tests/test_task_broadcasting.py b/tests/test_task_broadcasting.py index d7a2913..4a2209e 100644 --- a/tests/test_task_broadcasting.py +++ b/tests/test_task_broadcasting.py @@ -271,7 +271,7 @@ def test_faster_task_to_recv_is_cancelled_by_slower( # the faster subtask was cancelled break - # await tractor.breakpoint() + # await tractor.pause() # await stream.receive() print(f'final value: {value}')