Skip to content

Commit

Permalink
Set default timeout in test helpers to 100 (beam-community#607)
Browse files Browse the repository at this point in the history
Commit aa8c458 introduced the ability to accept a timeout option in test
helpers. To consolidate logic, it extracted a `get_timeout/1` function,
but it incorrectly set the default value to 1000 ms. This commit
corrects that by setting it to 100 ms.

We also take the opportunity to use the `get_timeout/1` helper from the
`refute_timeout/1` function, thus we consolidate all fetching of the
`:timeout` option to the `get_timeout/1` helper.
  • Loading branch information
germsvel committed May 27, 2021
1 parent aa8c458 commit dbc9203
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/bamboo/test.ex
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ defmodule Bamboo.Test do
but may incorrectly pass if an email is delivered *after* the timeout.
"""
else
Keyword.get(opts, :timeout, 100)
get_timeout(opts)
end
end

Expand All @@ -493,5 +493,5 @@ defmodule Bamboo.Test do
end

@doc false
def get_timeout(opts), do: Keyword.get(opts, :timeout, 1000)
def get_timeout(opts), do: Keyword.get(opts, :timeout, 100)
end

0 comments on commit dbc9203

Please sign in to comment.