Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] [exporterhelper] Remove redundant test helper #8625

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions exporter/exporterhelper/queue_sender_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,6 @@ func TestQueuedRetryPersistentEnabled_shutdown_dataIsRequeued(t *testing.T) {
rCfg.InitialInterval = time.Millisecond
rCfg.MaxElapsedTime = 0 // retry infinitely so shutdown can be triggered

req := newMockRequest(context.Background(), 3, errors.New("some error"))

be, err := newBaseExporter(defaultSettings, "", false, nil, nil, newNoopObsrepSender, WithRetry(rCfg), WithQueue(qCfg))
require.NoError(t, err)

Expand All @@ -320,13 +318,8 @@ func TestQueuedRetryPersistentEnabled_shutdown_dataIsRequeued(t *testing.T) {
}
be.queueSender.(*queueSender).requeuingEnabled = true

// replace nextSender inside retrySender to always return error so it doesn't exit send loop
be.retrySender.setNextSender(&errorRequestSender{
errToReturn: errors.New("some error"),
})

// Invoke queuedRetrySender so the producer will put the item for consumer to poll
require.NoError(t, be.send(req))
require.NoError(t, be.send(newErrorRequest(context.Background())))

// first wait for the item to be produced to the queue initially
assert.Eventually(t, func() bool {
Expand Down
9 changes: 0 additions & 9 deletions exporter/exporterhelper/retry_sender_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,12 +404,3 @@ func (pcq *producerConsumerQueueWithCounter) Produce(item internal.Request) bool
pcq.produceCounter.Add(1)
return pcq.ProducerConsumerQueue.Produce(item)
}

type errorRequestSender struct {
baseRequestSender
errToReturn error
}

func (rs *errorRequestSender) send(_ internal.Request) error {
return rs.errToReturn
}
Loading