From 47158a6437f89af90fc1bd2dde559a18264cd4af Mon Sep 17 00:00:00 2001 From: Sohil Kshirsagar Date: Mon, 16 Mar 2026 08:52:37 -0700 Subject: [PATCH] fix: add actionable warning for background requests during replay --- drift/core/mode_utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drift/core/mode_utils.py b/drift/core/mode_utils.py index 5ad0012..69d9d3a 100644 --- a/drift/core/mode_utils.py +++ b/drift/core/mode_utils.py @@ -113,7 +113,9 @@ def handle_replay_mode( # Background request: App is ready + not within a trace (no parent span) + not a server request if is_app_ready and not current_span_info and not is_server_request: - logger.debug("[ModeUtils] Handling no-op request") + logger.warning( + "[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." + ) return no_op_request_handler() return replay_mode_handler()