forked from goodboy/tractor
Better early timeout handling, continue on child re-lock
parent
b01f594025
commit
c5c7e694ec
|
@ -422,26 +422,21 @@ def test_multi_nested_subactors_error_through_nurseries(spawn):
|
||||||
|
|
||||||
child = spawn('multi_nested_subactors_error_up_through_nurseries')
|
child = spawn('multi_nested_subactors_error_up_through_nurseries')
|
||||||
|
|
||||||
|
timed_out_early: bool = False
|
||||||
|
|
||||||
for i in range(12):
|
for i in range(12):
|
||||||
try:
|
try:
|
||||||
child.expect(r"\(Pdb\+\+\)")
|
child.expect(r"\(Pdb\+\+\)")
|
||||||
child.sendline('c')
|
child.sendline('c')
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
||||||
except (
|
except pexpect.exceptions.EOF:
|
||||||
pexpect.exceptions.EOF,
|
|
||||||
pexpect.exceptions.TIMEOUT,
|
|
||||||
):
|
|
||||||
# races all over..
|
|
||||||
|
|
||||||
print(f"Failed early on {i}?")
|
|
||||||
before = str(child.before.decode())
|
|
||||||
|
|
||||||
timed_out_early = True
|
|
||||||
|
|
||||||
# race conditions on how fast the continue is sent?
|
# race conditions on how fast the continue is sent?
|
||||||
|
print(f"Failed early on {i}?")
|
||||||
|
timed_out_early = True
|
||||||
break
|
break
|
||||||
|
else:
|
||||||
child.expect(pexpect.EOF)
|
child.expect(pexpect.EOF)
|
||||||
|
|
||||||
if not timed_out_early:
|
if not timed_out_early:
|
||||||
|
@ -499,6 +494,7 @@ def test_root_nursery_cancels_before_child_releases_tty_lock(
|
||||||
child.expect(pexpect.EOF)
|
child.expect(pexpect.EOF)
|
||||||
break
|
break
|
||||||
except pexpect.exceptions.TIMEOUT:
|
except pexpect.exceptions.TIMEOUT:
|
||||||
|
child.sendline('c')
|
||||||
print('child was able to grab tty lock again?')
|
print('child was able to grab tty lock again?')
|
||||||
|
|
||||||
if not timed_out_early:
|
if not timed_out_early:
|
||||||
|
|
Loading…
Reference in New Issue