Skip to content

Commit

Permalink
Changing the while loop, printing exit status if we look for it
Browse files Browse the repository at this point in the history
  • Loading branch information
Soren Ptak committed Jul 6, 2023
1 parent 4dc2b64 commit cdfd616
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions executable-monitor/executable-monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@
logging.info(f"Running executable: {exe_abs_path} ")
logging.info(f"Storing logs in: {log_dir}")
logging.info(f"Timeout (seconds): {args.timeout_seconds}")
logging.info(f"Searching for success line {args.success_line}")
logging.info(f"Searching for success line: {args.success_line}")
logging.info(f"Attempting the run {retryAttempts} times")

if args.success_exit_status is not None:
logging.info("Looking for exit status {0}".format(args.success_exit_status ))
for attempts in range(0,retryAttempts):

# Initialize values
Expand All @@ -106,7 +107,7 @@

logging.info("START OF DEVICE OUTPUT\n")

while not (timeout_occurred or exe_exitted or (not wait_for_exit and success_line_found)):
while ( not timeout_occurred) or ( not exe_exitted ) or (not success_line_found and not wait_for_exit ) or (success_line_found and wait_for_exit ):

# Sleep for a short duration between loops to not steal all system resources
# time.sleep(.1)
Expand Down

0 comments on commit cdfd616

Please sign in to comment.