From c529dbd6883e8f8dbf6b8096d88f774ab24b8e1d Mon Sep 17 00:00:00 2001 From: Trent Mick Date: Wed, 13 Dec 2023 16:20:54 -0800 Subject: [PATCH] test: fix race in redis-4 tests The beforeEach() hook was not awaited, so afterEach() could run before it completed, resulting in a client.disconnect() that rejects, and a mocha hook that calls done() twice. Refs: #1860 --- .../opentelemetry-instrumentation-redis-4/test/redis.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/node/opentelemetry-instrumentation-redis-4/test/redis.test.ts b/plugins/node/opentelemetry-instrumentation-redis-4/test/redis.test.ts index 74fa7b699c..68357450f3 100644 --- a/plugins/node/opentelemetry-instrumentation-redis-4/test/redis.test.ts +++ b/plugins/node/opentelemetry-instrumentation-redis-4/test/redis.test.ts @@ -71,7 +71,7 @@ describe('redis@^4.0.0', () => { client = createClient({ url: redisTestUrl, }); - context.with(suppressTracing(context.active()), async () => { + await context.with(suppressTracing(context.active()), async () => { await client.connect(); }); });