Skip to content

Commit

Permalink
test: prevent infinite loop when zplayer exits before first frame
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed Nov 29, 2023
1 parent d90410d commit a56646b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/run_replay_tests.py
Expand Up @@ -863,6 +863,9 @@ def on_result_updated(w: ReplayResultUpdatedHandler):
while watcher.observer.is_alive():
watcher.update_result()

if player_interface.poll() != None:
break

# Don't apply timeout until beyond the first frame, since JIT may take a moment for big scripts.
if watcher.result['frame'] == 0:
continue
Expand All @@ -871,9 +874,6 @@ def on_result_updated(w: ReplayResultUpdatedHandler):
last_frame = watcher.result['frame']
raise ReplayTimeoutException(f'timed out, replay got stuck around frame {last_frame}')

if player_interface.poll() != None:
break

yield (key, 'status', result)

player_interface.wait_for_finish()
Expand Down

0 comments on commit a56646b

Please sign in to comment.