From 835a213dd1d70aade7ae485d11ffd489093e942b Mon Sep 17 00:00:00 2001 From: Luca Filipponi Date: Wed, 21 Aug 2024 12:55:26 +0100 Subject: [PATCH] fixed failing tests and linter --- instrumentation/net/http/otelhttp/test/transport_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/instrumentation/net/http/otelhttp/test/transport_test.go b/instrumentation/net/http/otelhttp/test/transport_test.go index dfe8bcc78a8..6f38363fd6b 100644 --- a/instrumentation/net/http/otelhttp/test/transport_test.go +++ b/instrumentation/net/http/otelhttp/test/transport_test.go @@ -585,15 +585,14 @@ func TestDefaultAttributesHandling(t *testing.T) { require.NoError(t, err) resp, err := client.Do(r) - resp.Body.Close() require.NoError(t, err) + _ = resp.Body.Close() + err = reader.Collect(ctx, &rm) assert.NoError(t, err) - // http.client.response.size is not recorded so the assert.Len - // above should be 2 instead of 3(test bonus) - assert.Len(t, rm.ScopeMetrics[0].Metrics, 2) + assert.Len(t, rm.ScopeMetrics[0].Metrics, 3) for _, m := range rm.ScopeMetrics[0].Metrics { switch m.Name { case clientRequestSize: