Skip to content

Commit 290b9b0

Browse files
committed
contest: vm: auto-lower timeout to 5min if we see a crash
net and forwarding need very long timeouts, if a bad change gets in we end up waiting until timeout in multiple tests. Most likely for hours. Signed-off-by: Jakub Kicinski <[email protected]>
1 parent bfbd135 commit 290b9b0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

contest/remote/lib/vm.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,9 @@ def _read_pipe_nonblock(self, pipe):
261261
return read_some, output
262262

263263
def drain_to_prompt(self, prompt="xx__-> ", dump_after=None):
264+
_dump_after = dump_after
264265
if dump_after is None:
265-
dump_after = int(self.config.get('vm', 'default_timeout'))
266+
dump_after = self.config.getint('vm', 'default_timeout')
266267
hard_stop = int(self.config.get('vm', 'hard_timeout',
267268
fallback=(1 << 63)))
268269
waited = 0
@@ -281,6 +282,10 @@ def drain_to_prompt(self, prompt="xx__-> ", dump_after=None):
281282
if read_some:
282283
if stdout.endswith(prompt):
283284
break
285+
if self.fail_state == "oops" and _dump_after is None and dump_after > 300:
286+
dump_after = 300
287+
self.log_out += '\nDETECTED CRASH, lowering timeout\n'
288+
284289
# A bit of a hack, sometimes kernel spew will clobber
285290
# the prompt. Until we have a good way of sending kernel
286291
# logs elsewhere try to get a new prompt by sending a new line.

0 commit comments

Comments
 (0)