Skip to content

Commit ced1021

Browse files
committed
exponential backoff
1 parent f326bbf commit ced1021

File tree

1 file changed

+2
-2
lines changed
  • browsergym/webarena_verified/src/browsergym/webarena_verified

1 file changed

+2
-2
lines changed

browsergym/webarena_verified/src/browsergym/webarena_verified/task.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def setup(self, page: playwright.sync_api.Page) -> tuple[str, dict]:
125125
except playwright_errors.TimeoutError as e:
126126
if attempt == 2: # Last attempt (0, 1, 2)
127127
raise # Re-raise the timeout error after 3 failed attempts
128-
sleep(1) # Wait 1 second before retrying
128+
sleep(2**attempt) # Exponential backoff
129129

130130
# enable playwright tracing (required for webarena_verified evaluation)
131131
page.context.tracing.start(snapshots=True)
@@ -145,7 +145,7 @@ def setup(self, page: playwright.sync_api.Page) -> tuple[str, dict]:
145145
except playwright_errors.TimeoutError as e:
146146
if attempt == 2: # Last attempt (0, 1, 2)
147147
raise # Re-raise the timeout error after 3 failed attempts
148-
sleep(1) # Wait 1 second before retrying
148+
sleep(2**attempt) # Exponential backoff
149149
if i < len(start_urls) - 1:
150150
page = page.context.new_page()
151151

0 commit comments

Comments
 (0)