Skip to content

Commit d092fd4

Browse files
authored
test: Remove unnecessary test waits (#22383)
Removes the `await Promise.resolve()` microtick yields at the start of the ioredis, mysql2 and redis diagnostics-channel tracing scenarios. These were added to give the DC subscriber a chance to register before the driver created/published on its native `TracingChannel`s. With the orchestrion instrumentation now reliably wiring up channel subscribers before the instrumented module publishes, the manual yield is no longer needed and the scenarios are simpler without it.
1 parent ffcf353 commit d092fd4

3 files changed

Lines changed: 0 additions & 12 deletions

File tree

dev-packages/node-integration-tests/suites/tracing/ioredis-dc/scenario-ioredis-5-11.mjs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import * as Sentry from '@sentry/node';
22

33
async function run() {
4-
// Yield a microtick so the DC subscriber (deferred via Promise.resolve().then)
5-
// is registered before ioredis creates its native TracingChannels on import.
6-
await Promise.resolve();
7-
84
const { default: Redis } = await import('ioredis-5');
95
const redisClient = new Redis({ host: '127.0.0.1', port: 6382, lazyConnect: true });
106

dev-packages/node-integration-tests/suites/tracing/mysql2-tracing-channel/scenario.mjs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ const CONNECT_CONFIG = {
1010
};
1111

1212
async function run() {
13-
// Yield a microtick so the DC subscriber (deferred via Promise.resolve().then)
14-
// is registered before mysql2 publishes on its native TracingChannels.
15-
await Promise.resolve();
16-
1713
// Gate on the DB actually accepting a connection before opening the span (see `waitForConnection`).
1814
// MySQL keeps finalizing for a short window after the healthcheck passes and drops early handshakes,
1915
// so this retries a real connect. It runs outside an active span, so the connect stays uninstrumented.

dev-packages/node-integration-tests/suites/tracing/redis-dc/scenario-redis-5-tracing.mjs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import * as Sentry from '@sentry/node';
22

33
async function run() {
4-
// Yield a microtick so the DC subscriber (deferred via Promise.resolve().then)
5-
// is registered before node-redis eagerly creates its native TracingChannels on require().
6-
await Promise.resolve();
7-
84
const { createClient } = await import('redis-5-tracing');
95
const redisClient = await createClient({ socket: { host: '127.0.0.1', port: 6381 } }).connect();
106

0 commit comments

Comments
 (0)