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:
@@ -55,19 +55,20 @@ def log_lines():
|
||||
def wait_log(pattern, timeout, since):
|
||||
end = time.time() + timeout
|
||||
while time.time() < end:
|
||||
for i in range(since, len(log_lines())):
|
||||
if pattern in log_lines()[i]:
|
||||
return log_lines()[i]
|
||||
lines = log_lines()
|
||||
for i in range(since, len(lines)):
|
||||
if pattern in lines[i]:
|
||||
return lines[i]
|
||||
time.sleep(0.2)
|
||||
return None
|
||||
|
||||
def wait_gui(ch, timeout, since):
|
||||
end = time.time() + timeout
|
||||
while time.time() < end:
|
||||
for i in range(since, len(log_lines())):
|
||||
l = log_lines()[i]
|
||||
if "GUI attached hwnd=" in l and f"ch={ch}" in l:
|
||||
return l
|
||||
lines = log_lines()
|
||||
for i in range(since, len(lines)):
|
||||
if "GUI attached hwnd=" in lines[i] and f"ch={ch}" in lines[i]:
|
||||
return lines[i]
|
||||
time.sleep(0.2)
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user