6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 13:33:07 +01:00
This commit is contained in:
pavel-zotov 2024-06-14 11:10:19 +03:00
commit 1e0badd7dd

View File

@ -1265,17 +1265,24 @@ def trace_thread(act: Action, b: Barrier, cfg: List[str], output: List[str], kee
role: User role
stop: Event used to stop the trace thread
"""
with act.connect_server(encoding=encoding, encoding_errors=encoding_errors,
user=user, password=password) as srv:
output.append(srv.trace.start(config='\n'.join(cfg)))
b.wait()
while not stop.is_set():
line = srv.readline_timed(1)
if line is not TIMEOUT:
if not line:
stop.set()
elif keep_log:
output.append(line)
connected = False
try:
with act.connect_server(encoding=encoding, encoding_errors=encoding_errors,
user=user, password=password) as srv:
output.append(srv.trace.start(config='\n'.join(cfg)))
b.wait()
connected = True
while not stop.is_set():
line = srv.readline_timed(1)
if line is not TIMEOUT:
if not line:
stop.set()
elif keep_log:
output.append(line)
except:
if not connected:
b.wait()
raise
class TraceSession:
"""Object to manage Firebird trace session.