mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
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>
This commit is contained in:
committed by
Christian Decker
parent
4b178621e2
commit
15aaf9f49a
@@ -2497,7 +2497,7 @@ class LightningDTests(BaseLightningDTests):
|
|||||||
|
|
||||||
# Stop l2, l1 will reattempt to connect
|
# Stop l2, l1 will reattempt to connect
|
||||||
print("Killing l2 in mid HTLC")
|
print("Killing l2 in mid HTLC")
|
||||||
l2.daemon.proc.terminate()
|
l2.daemon.kill()
|
||||||
|
|
||||||
# Clear the disconnect and timer stop so we can proceed normally
|
# 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]
|
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')
|
l1.daemon.wait_for_log('dev_disconnect: \+WIRE_COMMITMENT_SIGNED')
|
||||||
|
|
||||||
print("Killing l1 in mid HTLC")
|
print("Killing l1 in mid HTLC")
|
||||||
l1.daemon.proc.terminate()
|
l1.daemon.kill()
|
||||||
|
|
||||||
# Restart l1, without disconnect stuff.
|
# Restart l1, without disconnect stuff.
|
||||||
l1.daemon.cmd_line.remove('--no-reconnect')
|
l1.daemon.cmd_line.remove('--no-reconnect')
|
||||||
@@ -2595,7 +2595,7 @@ class LightningDTests(BaseLightningDTests):
|
|||||||
l1.daemon.wait_for_log('dev_disconnect: \+WIRE_COMMITMENT_SIGNED')
|
l1.daemon.wait_for_log('dev_disconnect: \+WIRE_COMMITMENT_SIGNED')
|
||||||
|
|
||||||
print("Killing l1 in mid HTLC")
|
print("Killing l1 in mid HTLC")
|
||||||
l1.daemon.proc.terminate()
|
l1.daemon.kill()
|
||||||
|
|
||||||
# Restart l1, without disconnect stuff.
|
# Restart l1, without disconnect stuff.
|
||||||
l1.daemon.cmd_line.remove('--no-reconnect')
|
l1.daemon.cmd_line.remove('--no-reconnect')
|
||||||
|
|||||||
@@ -85,6 +85,12 @@ class TailableProc(object):
|
|||||||
|
|
||||||
return self.proc.returncode
|
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):
|
def tail(self):
|
||||||
"""Tail the stdout of the process and remember it.
|
"""Tail the stdout of the process and remember it.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user