Commit c0adf81c authored by Julien Muchembled's avatar Julien Muchembled

qa: fix occasional deadlock when starting subprocesses in functional tests

parent 01a01c8c
...@@ -206,6 +206,13 @@ class NEOLogger(Logger): ...@@ -206,6 +206,13 @@ class NEOLogger(Logger):
self._setup(filename, reset) self._setup(filename, reset)
__del__ = setup __del__ = setup
def fork(self):
with self:
pid = os.fork()
if pid:
return pid
self._setup()
def isEnabledFor(self, level): def isEnabledFor(self, level):
return True return True
......
...@@ -158,7 +158,7 @@ class NEOProcess(object): ...@@ -158,7 +158,7 @@ class NEOProcess(object):
if args: if args:
os.close(w) os.close(w)
os.kill(os.getpid(), signal.SIGSTOP) os.kill(os.getpid(), signal.SIGSTOP)
self.pid = os.fork() self.pid = logging.fork()
if self.pid: if self.pid:
# Wait that the signal to kill the child is set up. # Wait that the signal to kill the child is set up.
os.close(w) os.close(w)
...@@ -168,8 +168,6 @@ class NEOProcess(object): ...@@ -168,8 +168,6 @@ class NEOProcess(object):
else: else:
# Child # Child
try: try:
# release SQLite debug log
logging.setup()
signal.signal(signal.SIGTERM, lambda *args: sys.exit()) signal.signal(signal.SIGTERM, lambda *args: sys.exit())
if coverage: if coverage:
coverage.stop() coverage.stop()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment