Skip to content

Commit 99daddd

Browse files
fix: add actionable warning for background requests during replay
1 parent 5df98d6 commit 99daddd

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/instrumentation/core/utils/modeUtils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ export function handleReplayMode<T>({
7373

7474
// Background request: App is ready + not within a trace (no parent span) + not a server request
7575
if (isAppReady && !currentSpanInfo && !isServerRequest) {
76-
logger.debug(`[ModeUtils] Handling no-op request`);
76+
logger.warn(
77+
`[ModeUtils] Background request detected during replay (no active trace context). This typically means a background job, scheduled task, or middleware (e.g., rate limiters, message consumers) is running outside of a test trace. To avoid errors, disable these services when TUSK_DRIFT_MODE=REPLAY.`,
78+
);
7779
// This is a background request (app is ready and no parent span), call the backgroundRequestHandler
7880
return noOpRequestHandler();
7981
}

0 commit comments

Comments
 (0)