Browse Source

test_lightning.py: shutdown tail thread before killing.

Seems to avoid the nasty python resource warnings, as well as the
fatal 'ValueError: PyMemoryView_FromBuffer(): info->buf must not be NULL'

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 7 years ago
committed by Christian Decker
parent
commit
15aaf9f49a
  1. 6
      tests/test_lightningd.py
  2. 6
      tests/utils.py

6
tests/test_lightningd.py

@ -2497,7 +2497,7 @@ class LightningDTests(BaseLightningDTests):
# Stop l2, l1 will reattempt to connect
print("Killing l2 in mid HTLC")
l2.daemon.proc.terminate()
l2.daemon.kill()
# Clear the disconnect and timer stop so we can proceed normally
l2.daemon.cmd_line = [e for e in l2.daemon.cmd_line if 'disconnect' not in e]
@ -2554,7 +2554,7 @@ class LightningDTests(BaseLightningDTests):
l1.daemon.wait_for_log('dev_disconnect: \+WIRE_COMMITMENT_SIGNED')
print("Killing l1 in mid HTLC")
l1.daemon.proc.terminate()
l1.daemon.kill()
# Restart l1, without disconnect stuff.
l1.daemon.cmd_line.remove('--no-reconnect')
@ -2595,7 +2595,7 @@ class LightningDTests(BaseLightningDTests):
l1.daemon.wait_for_log('dev_disconnect: \+WIRE_COMMITMENT_SIGNED')
print("Killing l1 in mid HTLC")
l1.daemon.proc.terminate()
l1.daemon.kill()
# Restart l1, without disconnect stuff.
l1.daemon.cmd_line.remove('--no-reconnect')

6
tests/utils.py

@ -85,6 +85,12 @@ class TailableProc(object):
return self.proc.returncode
def kill(self):
"""Kill process without giving it warning."""
self.proc.kill()
self.proc.wait()
self.thread.join()
def tail(self):
"""Tail the stdout of the process and remember it.

Loading…
Cancel
Save