Skip to content

Commit

Permalink
Retry emulator.wait_for_start() if it fails
Browse files Browse the repository at this point in the history
  • Loading branch information
jgraham committed Mar 14, 2024
1 parent e25a0c8 commit a4a6ea8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tools/wpt/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,16 @@ def start(logger, dest=None, reinstall=False, prompt=True, device_serial=None):
emulator.start()
timer = threading.Timer(300, cancel_start(threading.get_ident()))
timer.start()
emulator.wait_for_start()
for i in range(10):
logger.info(f"Wait for emulator to start attempt {i + 1}/10")
try:
emulator.wait_for_start()
except Exception:
import traceback
logger.warning(f"""emulator.wait_for_start() failed:
{traceback.format_exc()}""")
else:
break
timer.cancel()
return emulator

Expand Down

0 comments on commit a4a6ea8

Please sign in to comment.