Adjust debug tests to accomodate no more root clobbering

db_backup
Tyler Goodlet 2021-06-30 13:49:56 -04:00
parent 3483ed4e6f
commit 340d1f6182
1 changed files with 36 additions and 9 deletions

View File

@ -307,20 +307,47 @@ def test_multi_daemon_subactors(spawn, loglevel):
before = str(child.before.decode()) before = str(child.before.decode())
assert "NameError" in before assert "NameError" in before
child.sendline('c') # XXX: hoorayy the root clobering the child here was fixed!
# now the root actor won't clobber the bp_forever child
# during it's first access to the debug lock, but will instead
# wait for the lock to release, by the edge triggered
# ``_debug._no_remote_has_tty`` event before sending cancel messages
# (via portals) to its underlings B)
# IMO, this demonstrates the true power of SC system design.
child.sendline('c')
child.expect(r"\(Pdb\+\+\)")
before = str(child.before.decode())
assert "Attaching pdb to actor: ('bp_forever'," in before
child.sendline('c')
child.expect(r"\(Pdb\+\+\)") child.expect(r"\(Pdb\+\+\)")
before = str(child.before.decode()) before = str(child.before.decode())
assert "tractor._exceptions.RemoteActorError: ('name_error'" in before
try: try:
child.sendline('c') # final error in root
child.expect(pexpect.EOF) assert "tractor._exceptions.RemoteActorError: ('name_error'" in before
except pexpect.exceptions.TIMEOUT:
# Failed to exit using continue..?
child.sendline('q') except AssertionError:
child.expect(pexpect.EOF) # except pexpect.exceptions.TIMEOUT:
# one last entry in the root
child.sendline('c')
child.expect(r"\(Pdb\+\+\)")
before = str(child.before.decode())
assert "tractor._exceptions.RemoteActorError: ('name_error'" in before
# theory there should have been some msg like this from
# root announcing it avoided a clobber of the child's lock,
# but it seems unreliable in testing here to gnab it.
# assert "in use by child ('bp_forever'," in before
child.sendline('c')
# final error in root
assert "tractor._exceptions.RemoteActorError: ('name_error'" in before
child.expect(pexpect.EOF)
def test_multi_subactors_root_errors(spawn): def test_multi_subactors_root_errors(spawn):
@ -372,7 +399,7 @@ 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')
# startup time can be iffy # startup time can be iffy
time.sleep(1) # time.sleep(1)
for i in range(12): for i in range(12):
try: try: