Skip to content

Commit a114967

Browse files
committed
fix another panic
1 parent d6afbbb commit a114967

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

modules/frontend/v1/request_batch_test.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111

1212
"github.com/grafana/dskit/httpgrpc"
1313
"github.com/grafana/tempo/modules/frontend/pipeline"
14+
"github.com/stretchr/testify/assert"
1415
"github.com/stretchr/testify/require"
1516
)
1617

@@ -142,9 +143,10 @@ func TestErrorsPropagateUpstream(t *testing.T) {
142143
require.ErrorContains(t, err, "foo")
143144
wg.Done()
144145
}()
145-
146+
req := httptest.NewRequest("GET", "http://example.com", nil)
146147
_ = rb.add(&request{
147-
err: errChan,
148+
request: pipeline.NewHTTPRequest(req),
149+
err: errChan,
148150
})
149151
}
150152

@@ -165,11 +167,13 @@ func TestResponsesPropagateUpstream(t *testing.T) {
165167
wg.Add(1)
166168
go func(expectedCode int32) {
167169
resp := <-responseChan
168-
require.Equal(t, expectedCode, resp.StatusCode)
170+
assert.Equal(t, expectedCode, int32(resp.StatusCode))
169171
wg.Done()
170172
}(i)
171173

174+
req := httptest.NewRequest("GET", "http://example.com", nil)
172175
_ = rb.add(&request{
176+
request: pipeline.NewHTTPRequest(req),
173177
response: responseChan,
174178
})
175179
}

0 commit comments

Comments
 (0)