Skip to content

Commit c21ea16

Browse files
authored
bug: fix flaky test TestQueuedRetry_RequeuingEnabled (#8989)
fixes a flaky test Fixing a bug - TestQueuedRetry_RequeuingEnabled has been failing occasionally. Upon investigation, `be.send` calls the underlying `observabilityConsumerSender.send` which calls `wg.Done()`, so we need to add `wg.Add(1)` before that Fixes #6624 **Testing:** Ran the same test multiple times before/after change: `go test -race -run TestQueuedRetry_RequeuingEnabled -count 1000`
1 parent 3b56bd0 commit c21ea16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

exporter/exporterhelper/queue_sender_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,9 @@ func TestQueuedRetry_RequeuingEnabled(t *testing.T) {
243243
traceErr := consumererror.NewTraces(errors.New("some error"), testdata.GenerateTraces(1))
244244
mockR := newMockRequest(1, traceErr)
245245
ocs.run(func() {
246+
ocs.waitGroup.Add(1) // necessary because we'll call send() again after requeueing
246247
// This is asynchronous so it should just enqueue, no errors expected.
247248
require.NoError(t, be.send(context.Background(), mockR))
248-
ocs.waitGroup.Add(1) // necessary because we'll call send() again after requeueing
249249
})
250250
ocs.awaitAsyncProcessing()
251251

0 commit comments

Comments
 (0)