From 3d1635b2bc44db3428e275d5b596e90c08af7896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 31 Jul 2024 10:21:35 +0200 Subject: [PATCH] Fix TestTransportErrorStatus --- instrumentation/net/http/otelhttp/test/transport_test.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/instrumentation/net/http/otelhttp/test/transport_test.go b/instrumentation/net/http/otelhttp/test/transport_test.go index 599eaf4f951..e61950dd7dd 100644 --- a/instrumentation/net/http/otelhttp/test/transport_test.go +++ b/instrumentation/net/http/otelhttp/test/transport_test.go @@ -101,13 +101,11 @@ func TestTransportErrorStatus(t *testing.T) { } resp, err := c.Do(r) if err == nil { - t.Fatal("transport should have returned an error, it didn't") - } - defer func() { if err := resp.Body.Close(); err != nil { t.Errorf("close response body: %v", err) } - }() + t.Fatal("transport should have returned an error, it didn't") + } // Check span. spans := spanRecorder.Ended()