Skip to content

Commit

Permalink
[chore] avoid negative waitGroup in test (#8783)
Browse files Browse the repository at this point in the history
When sending a retry, make sure to do so inside the run function of the
observability sender. Otherwise, tests may produce a negative wait group
error when we start to enforce shutdown of the queues.
  • Loading branch information
atoulme committed Oct 31, 2023
1 parent b776d50 commit adb9413
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion exporter/exporterhelper/queue_sender_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,10 @@ func TestQueuedRetry_RequeuingEnabledQueueFull(t *testing.T) {
traceErr := consumererror.NewTraces(errors.New("some error"), testdata.GenerateTraces(1))
mockR := newMockRequest(context.Background(), 1, traceErr)

require.Error(t, be.retrySender.send(mockR), "sending_queue is full")
ocs := be.obsrepSender.(*observabilityConsumerSender)
ocs.run(func() {
require.Error(t, be.retrySender.send(mockR), "sending_queue is full")
})
mockR.checkNumRequests(t, 1)
}

Expand Down

0 comments on commit adb9413

Please sign in to comment.