From 0d1bc4097f1d23a614d8da2874977103a389ca43 Mon Sep 17 00:00:00 2001 From: Daniel Dyla Date: Wed, 4 Oct 2023 11:26:47 -0400 Subject: [PATCH] Apply suggestions from code review --- .../test/common/export/BatchSpanProcessorBase.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/opentelemetry-sdk-trace-base/test/common/export/BatchSpanProcessorBase.test.ts b/packages/opentelemetry-sdk-trace-base/test/common/export/BatchSpanProcessorBase.test.ts index 663e014fe8..be4ff15248 100644 --- a/packages/opentelemetry-sdk-trace-base/test/common/export/BatchSpanProcessorBase.test.ts +++ b/packages/opentelemetry-sdk-trace-base/test/common/export/BatchSpanProcessorBase.test.ts @@ -530,7 +530,7 @@ describe('BatchSpanProcessorBase', () => { assert.equal(callbacks.length, 1) assert.equal(spans.length, 5) callbacks[0]({ code: ExportResultCode.SUCCESS }) - await new Promise(resolve => process.nextTick(resolve)) + await new Promise(resolve => setImmediate(resolve)) // After the first batch completes we will have dropped a number // of spans and the next batch will be smaller assert.equal(callbacks.length, 2) @@ -538,7 +538,7 @@ describe('BatchSpanProcessorBase', () => { callbacks[1]({ code: ExportResultCode.SUCCESS }) // We expect that all the other spans have been dropped - await new Promise(resolve => process.nextTick(resolve)) + await new Promise(resolve => setImmediate(resolve)) assert.equal(callbacks.length, 2) assert.equal(spans.length, 10) })