Skip to content

Commit

Permalink
test: handle io timeout failures
Browse files Browse the repository at this point in the history
  • Loading branch information
natesales committed Apr 5, 2024
1 parent 499d6ca commit d8a1dd6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ func TestMainInvalidUpstream(t *testing.T) {
"-s", "127.127.127.127:1",
"example.com",
)
if !(err != nil && strings.Contains(err.Error(), "connection refused")) {
if !(err != nil &&
(strings.Contains(err.Error(), "connection refused") ||
strings.Contains(err.Error(), "i/o timeout"))) {
t.Errorf("expected connection error, got %+v", err)
}
}
Expand Down

0 comments on commit d8a1dd6

Please sign in to comment.