Skip to content

Commit

Permalink
don't reset time_no_match in _answer_question, do it in run_shell_cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
boegel committed Apr 3, 2024
1 parent 2abb706 commit 23727d6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions easybuild/tools/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ def _answer_question(stdout, proc, qa_patterns, qa_wait_patterns):
except OSError as err:
raise EasyBuildError("Failed to answer question raised by interactive command: %s", err)

time_no_match = 0
match_found = True
break
else:
Expand All @@ -250,7 +249,6 @@ def _answer_question(stdout, proc, qa_patterns, qa_wait_patterns):
if regex.search(stdout):
_log.info(f"Found match for wait pattern '{pattern}'")
_log.debug(f"Found match for wait pattern '{pattern}' at end of stdout: {stdout[:1000]}")
time_no_match = 0
match_found = True
break
else:
Expand Down Expand Up @@ -435,7 +433,9 @@ def to_cmd_str(cmd):
stderr += proc.stderr.read1(read_size) or b''

if qa_patterns:
if not _answer_question(stdout, proc, qa_patterns, qa_wait_patterns):
if _answer_question(stdout, proc, qa_patterns, qa_wait_patterns):
time_no_match = 0
else:
_log.debug(f"No match found in question/wait patterns at end of stdout: {stdout[:1000]}")
# this will only run if the for loop above was *not* stopped by the break statement
time_no_match += check_interval_secs
Expand Down

0 comments on commit 23727d6

Please sign in to comment.