debug: fix G1.5 stress test wait_log to read log file once per poll (avoids false timeouts on 140k-line log)

This commit is contained in:
2026-08-16 10:23:55 +07:00
parent 40ee80ad60
commit 85273a6a7f
+8 -7
View File
@@ -55,19 +55,20 @@ def log_lines():
def wait_log(pattern, timeout, since): def wait_log(pattern, timeout, since):
end = time.time() + timeout end = time.time() + timeout
while time.time() < end: while time.time() < end:
for i in range(since, len(log_lines())): lines = log_lines()
if pattern in log_lines()[i]: for i in range(since, len(lines)):
return log_lines()[i] if pattern in lines[i]:
return lines[i]
time.sleep(0.2) time.sleep(0.2)
return None return None
def wait_gui(ch, timeout, since): def wait_gui(ch, timeout, since):
end = time.time() + timeout end = time.time() + timeout
while time.time() < end: while time.time() < end:
for i in range(since, len(log_lines())): lines = log_lines()
l = log_lines()[i] for i in range(since, len(lines)):
if "GUI attached hwnd=" in l and f"ch={ch}" in l: if "GUI attached hwnd=" in lines[i] and f"ch={ch}" in lines[i]:
return l return lines[i]
time.sleep(0.2) time.sleep(0.2)
return None return None