diff --git a/pkg/protocol/http1/server_test.go b/pkg/protocol/http1/server_test.go index 5f8f78247..dc8790a97 100644 --- a/pkg/protocol/http1/server_test.go +++ b/pkg/protocol/http1/server_test.go @@ -443,3 +443,13 @@ type mockErrorWriter struct { func (errorWriter *mockErrorWriter) Flush() error { return errors.New("error") } + +func TestShouldRecordInTraceError(t *testing.T) { + assert.False(t, shouldRecordInTraceError(nil)) + assert.False(t, shouldRecordInTraceError(errHijacked)) + assert.False(t, shouldRecordInTraceError(errIdleTimeout)) + assert.False(t, shouldRecordInTraceError(errShortConnection)) + + assert.True(t, shouldRecordInTraceError(errTimeout)) + assert.True(t, shouldRecordInTraceError(errors.New("foo error"))) +}