Skip to content

Commit

Permalink
Fix arithmetic error in exponential backoff, part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
safwank committed Oct 26, 2018
1 parent 1e046cd commit 6019232
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defmodule Retry.Mixfile do
name: "retry",
description:
"Simple Elixir macros for linear retry, exponential backoff and wait with composable delays.",
version: "0.11.0",
version: "0.11.1",
elixir: "~> 1.5",
source_url: "https://github.com/safwank/ElixirRetry",
build_embedded: Mix.env() == :prod,
Expand Down
7 changes: 7 additions & 0 deletions test/retry/delay_streams_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ defmodule Retry.DelayStreamsTest do
test "returns exponentially increasing delays starting with given initial delay" do
assert exponential_backoff(100) |> Enum.take(5) == [100, 200, 400, 800, 1600]
end

test "doesn't raise arithmetric error for large streams" do
assert exponential_backoff(100)
|> cap(30_000)
|> Enum.take(10_000)
|> Enum.count() == 10_000
end
end

describe "lin_backoff/2" do
Expand Down

0 comments on commit 6019232

Please sign in to comment.