Loosen timeout on nested child re-locking

signint_saviour
Tyler Goodlet 2022-08-01 14:28:04 -04:00
parent c5c7a9027c
commit 54de72d8df
1 changed files with 8 additions and 6 deletions

View File

@ -742,7 +742,7 @@ def test_multi_nested_subactors_error_through_nurseries(
assert "NameError" in before assert "NameError" in before
@pytest.mark.timeout(15) @pytest.mark.timeout(20)
def test_root_nursery_cancels_before_child_releases_tty_lock( def test_root_nursery_cancels_before_child_releases_tty_lock(
spawn, spawn,
start_method, start_method,
@ -798,22 +798,24 @@ def test_root_nursery_cancels_before_child_releases_tty_lock(
for i in range(3): for i in range(3):
try: try:
child.expect(pexpect.EOF) child.expect(pexpect.EOF, timeout=0.5)
break break
except TIMEOUT: except TIMEOUT:
child.sendline('c') child.sendline('c')
time.sleep(0.1) time.sleep(0.1)
print('child was able to grab tty lock again?') print('child was able to grab tty lock again?')
else: else:
print('giving up on child releasing, sending `quit` cmd')
child.sendline('q') child.sendline('q')
child.expect(pexpect.EOF) child.expect(pexpect.EOF)
if not timed_out_early: if not timed_out_early:
before = str(child.before.decode()) before = str(child.before.decode())
assert "tractor._exceptions.RemoteActorError: ('spawner0'" in before assert_before(child, [
assert "tractor._exceptions.RemoteActorError: ('name_error'" in before "tractor._exceptions.RemoteActorError: ('spawner0'",
assert "NameError: name 'doggypants' is not defined" in before "tractor._exceptions.RemoteActorError: ('name_error'",
"NameError: name 'doggypants' is not defined",
])
def test_root_cancels_child_context_during_startup( def test_root_cancels_child_context_during_startup(