Browse Source

tests/test_misc.py: Add a test for issue #4240.

fix-mocks
ZmnSCPxj jxPCSnmZ 4 years ago
committed by Rusty Russell
parent
commit
67d8fdcc75
  1. 11
      tests/test_misc.py

11
tests/test_misc.py

@ -1532,6 +1532,7 @@ def test_feerates(node_factory):
assert htlc_success_cost == htlc_feerate * 703 // 1000
@pytest.mark.xfail(strict=True)
def test_logging(node_factory):
# Since we redirect, node.start() will fail: do manually.
l1 = node_factory.get_node(options={'log-file': 'logfile'}, start=False)
@ -1554,6 +1555,16 @@ def test_logging(node_factory):
return len(log2) > 0 and log2[0].endswith("Started log due to SIGHUP\n")
wait_for(check_new_log)
# Issue #4240
# Repeated SIGHUP should just re-open the log file
# and not terminate the daemon.
logpath_moved_2 = os.path.join(l1.daemon.lightning_dir, TEST_NETWORK, 'logfile_moved_2')
shutil.move(logpath, logpath_moved_2)
l1.daemon.proc.send_signal(signal.SIGHUP)
wait_for(lambda: os.path.exists(logpath_moved_2))
wait_for(lambda: os.path.exists(logpath))
wait_for(check_new_log)
@unittest.skipIf(VALGRIND,
"Valgrind sometimes fails assert on injected SEGV")

Loading…
Cancel
Save