common: log when we toggle IO logging, don't edit env in tests!

Tests were failing when in the same thread after a test which set
log_all_io=True, because SIGUSR1 seemed to be turning logging *off*.

This is due to Python using references not copies for assignment.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-08-17 13:46:34 +09:30
committed by Christian Decker
parent 9f044305db
commit 4c891f4661
2 changed files with 22 additions and 7 deletions

View File

@@ -81,7 +81,7 @@ class TailableProc(object):
def __init__(self, outputDir=None, verbose=True):
self.logs = []
self.logs_cond = threading.Condition(threading.RLock())
self.env = os.environ
self.env = os.environ.copy()
self.running = False
self.proc = None
self.outputDir = outputDir