Skip to content

Commit

Permalink
CR: change names of variables
Browse files Browse the repository at this point in the history
  • Loading branch information
radeusgd committed Apr 9, 2024
1 parent 37e5b2d commit 4fdcd77
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions distribution/lib/Standard/Test/0.0.0-dev/src/Test.enso
Original file line number Diff line number Diff line change
Expand Up @@ -190,18 +190,20 @@ type Test
with_retries ~action =
loc = Meta.get_source_location 1

# Delays are in seconds
sleep_time = 0.1
total_sleep_delay = if Environment.get "CI" . is_nothing . not then 10 else 2
milliseconds_between_attempts = 100
## We give the CI a bit more attempts, as failures are more annoying there.
For local development, a bit less retries is enough - there it is more
likely that a failure is not flaky but it is an actual error so we
don't want to spend too much time retrying when debugging the tests locally.
max_retries = if Environment.get "CI" . is_nothing . not then 100 else 20

max_iterations = total_sleep_delay / sleep_time
go i =
Panic.catch Any action caught_panic->
# If the iterations are exhausted, we rethrow the panic.
if i > max_iterations then Panic.throw caught_panic else
if i > max_retries then Panic.throw caught_panic else
if i % 10 == 0 then
IO.println "Still failing after "+i.to_text+" retries. ("+loc.to_display_text+")"
Thread.sleep (1000*sleep_time . floor)
Thread.sleep milliseconds_between_attempts
## TODO This used to be
@Tail_Call go (i+1)
We should re-add the tail call once https://github.com/enso-org/enso/issues/9251 is fixed.
Expand Down

0 comments on commit 4fdcd77

Please sign in to comment.