From dfeb71344f3398b9244b663efa944b0b87526651 Mon Sep 17 00:00:00 2001 From: Edgar Arakelyan Date: Fri, 13 Nov 2026 14:28:17 -0800 Subject: [PATCH] test(browser): the nudge test times the second capture from before the frame, not from the first capture The control arms its NUDGE_S wait before its first capture's task sends it, so the first capture is sent a moment after the wait starts and the second can follow it by a hair under NUDGE_S (0.49966 s on a loaded runner). Timing the second from before the frame call is what the control promises. Co-Authored-By: Claude Opus 5.5 --- packages/agentenv-protocol/tests/test_browser_recording.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/agentenv-protocol/tests/test_browser_recording.py b/packages/agentenv-protocol/tests/test_browser_recording.py index e3376c88f..2da359a0a 100644 --- a/packages/agentenv-protocol/tests/test_browser_recording.py +++ b/packages/agentenv-protocol/tests/test_browser_recording.py @@ -417,10 +417,11 @@ async def test_a_tab_behind_the_active_one_is_framed_once_a_second_capture_nudge pipe.emit("Target.targetCreated", {"targetInfo": {"targetId": "T1", "type": "page", "url": "about:blank"}}) pipe.emit("Target.attachedToTarget", {"sessionId": "s-T1", "targetInfo": {"targetId": "T1", "type": "page"}}) + asked = asyncio.get_running_loop().time() data, _, tab, _ = await control.frame("T1", load_wait_s=0) - (_, _, first), (_, _, second) = pipe.captured - assert (base64.b64decode(data), tab) == (b"behind", "T1") and second - first >= NUDGE_S + (_, _, _), (_, _, second) = pipe.captured + assert (base64.b64decode(data), tab) == (b"behind", "T1") and second - asked >= NUDGE_S @pytest.mark.asyncio