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 14b439e797..d6d86d93c8 100644 --- a/plugins/node/opentelemetry-instrumentation-redis-4/test/redis.test.ts +++ b/plugins/node/opentelemetry-instrumentation-redis-4/test/redis.test.ts @@ -314,7 +314,12 @@ describe('redis@^4.0.0', () => { // Ignore. If the test Redis is not at the default port we expect this // to error. } - await newClient.disconnect(); + try { + await newClient.disconnect(); + } catch (_disconnectErr) { + // Ignore. In redis@4.4.0 and earlier this disconnect throws + // "The client is closed" if the connect failed. + } const [span] = getTestSpans(); assert.strictEqual(span.name, 'redis-connect');