Skip to content

Commit

Permalink
Give webdrivers more time to start up. (#151)
Browse files Browse the repository at this point in the history
Especially the safari webdriver can need a lot of time to start.
  • Loading branch information
floitsch authored Jan 3, 2025
1 parent 2972d95 commit a5702f0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/webdriver.toit
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class WebDriver:
url := "http://localhost:$port"

MAX-ATTEMPTS := 20
sleep-time := 100
for i := 0; i < MAX-ATTEMPTS; i++:
exception := catch --unwind=(: i == MAX-ATTEMPTS - 1):
response := client_.post-json --uri="$url/session" {
Expand Down Expand Up @@ -92,7 +93,8 @@ class WebDriver:

if not exception: return
// Probably hasn't started yet. Just try again.
sleep --ms=(100 * i)
sleep --ms=sleep-time
sleep-time *= 2

close:
pid := child-process_
Expand Down

0 comments on commit a5702f0

Please sign in to comment.