mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-22 00:24:19 +01:00
tests/test_misc.py: Add a test for issue #4240.
This commit is contained in:
committed by
Rusty Russell
parent
4185a86d90
commit
67d8fdcc75
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user