Skip to content

Commit 4d929a9

Browse files
authored
[chore] Fix BenchmarkMemoryQueueWaitForResult test (#13006)
Fixes http://github.com/open-telemetry/opentelemetry-collector/issues/13004 Signed-off-by: Bogdan Drutu <[email protected]>
1 parent 05f573f commit 4d929a9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

exporter/exporterhelper/internal/queuebatch/memory_queue_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,10 @@ func BenchmarkMemoryQueueWaitForResult(b *testing.B) {
198198
wg := sync.WaitGroup{}
199199
consumed := &atomic.Int64{}
200200
q := newMemoryQueue[int64](memoryQueueSettings[int64]{sizer: sizerInt64{}, capacity: 1000, waitForResult: true})
201+
require.NoError(b, q.Start(context.Background(), componenttest.NewNopHost()))
201202

202203
// Consume async new data.
204+
wg.Add(1)
203205
go func() {
204206
defer wg.Done()
205207
for {
@@ -212,7 +214,6 @@ func BenchmarkMemoryQueueWaitForResult(b *testing.B) {
212214
}
213215
}()
214216

215-
require.NoError(b, q.Start(context.Background(), componenttest.NewNopHost()))
216217
b.ResetTimer()
217218
b.ReportAllocs()
218219
for i := 0; i < b.N; i++ {

0 commit comments

Comments
 (0)