Skip to content

Commit

Permalink
Fix build failure due to :connect_timeout from poster
Browse files Browse the repository at this point in the history
  • Loading branch information
pablocostass committed May 12, 2020
1 parent 6332f40 commit a1f11a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/excoveralls/poster.ex
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ defmodule ExCoveralls.Poster do
body
})."}

{:error, :timeout} ->
{:error, reason} when reason in [:timeout, :connect_timeout] ->
{:ok, "Unable to upload the report to '#{endpoint}' due to a timeout. Not failing the build."}

{:error, reason} ->
Expand Down
3 changes: 2 additions & 1 deletion test/poster_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ defmodule PosterTest do
end
end

test_with_mock "post json timeout", :hackney, [request: fn(_, _, _, _, _) -> {:error, :timeout} end] do
test_with_mock "post json timeout", :hackney, [request: fn(_, _, _, _, _) -> {:error, :timeout} end,
request: fn(_, _, _, _, _) -> {:error, :connect_timeout} end] do
assert capture_io(fn ->
assert ExCoveralls.Poster.execute("json") == :ok
end) =~ ~r/timeout/
Expand Down

0 comments on commit a1f11a0

Please sign in to comment.