From 63520b14449dfedbd6dd84b2aa99d2e0ea61249e Mon Sep 17 00:00:00 2001 From: Trent Mick Date: Thu, 14 Dec 2023 01:05:20 -0800 Subject: [PATCH] test: fix race in redis-4 tests (#1863) 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 Co-authored-by: Marc Pichler --- .../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 74fa7b699c8..68357450f34 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(); }); });