Skip to content

Commit a6200f2

Browse files
author
Dana Powers
committed
Increase fixture wait timeout to 30s; add wait-time logging
1 parent 4796d58 commit a6200f2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/service.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def dump_logs(self):
8080
for line in self.captured_stdout:
8181
logging.critical(line.rstrip())
8282

83-
def wait_for(self, pattern, timeout=10):
83+
def wait_for(self, pattern, timeout=30):
8484
t1 = time.time()
8585
while True:
8686
t2 = time.time()
@@ -91,11 +91,13 @@ def wait_for(self, pattern, timeout=10):
9191
logging.exception("Received exception when killing child process")
9292
self.dump_logs()
9393

94-
raise RuntimeError("Waiting for %r timed out" % pattern)
94+
raise RuntimeError("Waiting for %r timed out after %d seconds" % (pattern, timeout))
9595

9696
if re.search(pattern, '\n'.join(self.captured_stdout), re.IGNORECASE) is not None:
97+
logging.info("Found pattern %r in %d seconds via stdout", pattern, (t2 - t1))
9798
return
9899
if re.search(pattern, '\n'.join(self.captured_stderr), re.IGNORECASE) is not None:
100+
logging.info("Found pattern %r in %d seconds via stderr", pattern, (t2 - t1))
99101
return
100102
time.sleep(0.1)
101103

0 commit comments

Comments
 (0)