Skip to content

Commit 6019232

Browse files
committed
Fix arithmetic error in exponential backoff, part 2
1 parent 1e046cd commit 6019232

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ defmodule Retry.Mixfile do
77
name: "retry",
88
description:
99
"Simple Elixir macros for linear retry, exponential backoff and wait with composable delays.",
10-
version: "0.11.0",
10+
version: "0.11.1",
1111
elixir: "~> 1.5",
1212
source_url: "https://github.com/safwank/ElixirRetry",
1313
build_embedded: Mix.env() == :prod,

test/retry/delay_streams_test.exs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ defmodule Retry.DelayStreamsTest do
3131
test "returns exponentially increasing delays starting with given initial delay" do
3232
assert exponential_backoff(100) |> Enum.take(5) == [100, 200, 400, 800, 1600]
3333
end
34+
35+
test "doesn't raise arithmetric error for large streams" do
36+
assert exponential_backoff(100)
37+
|> cap(30_000)
38+
|> Enum.take(10_000)
39+
|> Enum.count() == 10_000
40+
end
3441
end
3542

3643
describe "lin_backoff/2" do

0 commit comments

Comments
 (0)