From fec2ba004c633be3782917a0fecc339b928d2e22 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sun, 31 Jul 2022 15:42:13 -0400 Subject: [PATCH] Bleh more nested actor hackin.. --- tests/test_debugger.py | 46 ++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/tests/test_debugger.py b/tests/test_debugger.py index 74c3fb3..9887c89 100644 --- a/tests/test_debugger.py +++ b/tests/test_debugger.py @@ -472,34 +472,40 @@ def test_multi_subactors( # quit the loop and expect parent to attach child.sendline('q') - if _ci_env and not ctlc: - try: - child.expect(r"\(Pdb\+\+\)") - except TIMEOUT: - # in ci seems like this can sometimes just result - # in full tree death? - print('tree died?') + try: + child.expect(r"\(Pdb\+\+\)") + except TIMEOUT: + if _ci_env and not ctlc: + raise - else: - before = str(child.before.decode()) - assert_before(child, [ - # debugger attaches to root - "Attaching to pdb in crashed actor: ('root'", + # in ci seems like this can sometimes just result + # in full tree death? + print('tree died?') - # expect a multierror with exceptions for each sub-actor - "RemoteActorError: ('breakpoint_forever'", - "RemoteActorError: ('name_error'", - "RemoteActorError: ('spawn_error'", - "RemoteActorError: ('name_error_1'", - 'bdb.BdbQuit', - ]) + else: + before = str(child.before.decode()) + assert_before(child, [ + # debugger attaches to root + "Attaching to pdb in crashed actor: ('root'", + + # expect a multierror with exceptions for each sub-actor + "RemoteActorError: ('breakpoint_forever'", + "RemoteActorError: ('name_error'", + "RemoteActorError: ('spawn_error'", + "RemoteActorError: ('name_error_1'", + 'bdb.BdbQuit', + ]) if ctlc: do_ctlc(child) # process should exit child.sendline('c') - child.expect(pexpect.EOF) + + try: + child.expect(pexpect.EOF) + except TIMEOUT: + child.expect(r"\(Pdb\+\+\)") # repeat of previous multierror for final output assert_before(child, [