From d8a1dd6c2750a843c9658afe93fc0fb748f718dd Mon Sep 17 00:00:00 2001 From: Nate Sales Date: Thu, 4 Apr 2024 22:18:27 -0400 Subject: [PATCH] test: handle io timeout failures --- main_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main_test.go b/main_test.go index f57043d..660fb94 100644 --- a/main_test.go +++ b/main_test.go @@ -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) } }