Skip to content

Commit 47158a6

Browse files
fix: add actionable warning for background requests during replay
1 parent 48ec419 commit 47158a6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drift/core/mode_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ def handle_replay_mode(
113113

114114
# Background request: App is ready + not within a trace (no parent span) + not a server request
115115
if is_app_ready and not current_span_info and not is_server_request:
116-
logger.debug("[ModeUtils] Handling no-op request")
116+
logger.warning(
117+
"[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."
118+
)
117119
return no_op_request_handler()
118120

119121
return replay_mode_handler()

0 commit comments

Comments
 (0)