diff --git a/pkg/util/log/http_sink_test.go b/pkg/util/log/http_sink_test.go index 7176a99ddaf6..57ecaad35c2f 100644 --- a/pkg/util/log/http_sink_test.go +++ b/pkg/util/log/http_sink_test.go @@ -161,7 +161,8 @@ func testBase( // to accommodate for the overhead of the logging call compared to // the timeout in the HTTP request. if deadline > 0 && logDuration > deadline { - t.Error("Log call exceeded timeout") + require.LessOrEqualf(t, logDuration, deadline, + "Log call exceeded timeout, expected to be less than %s, got %s", deadline.String(), logDuration.String()) } if hangServer { @@ -234,7 +235,7 @@ func TestHTTPSinkTimeout(t *testing.T) { }, } - testBase(t, defaults, nil /* testFn */, true /* hangServer */, 500*time.Millisecond, time.Duration(0)) + testBase(t, defaults, nil /* testFn */, true /* hangServer */, 1*time.Second, time.Duration(0)) } // TestHTTPSinkContentTypeJSON verifies that the HTTP sink content type