test(browser): scope capture-file cleanup assertion to POSIX
The real-profile capture unlink is best-effort by design (_unlink_command_output_files swallows OSError). On Windows the resident daemon grandchild keeps its inherited handles open, so the temp files survive the call until the daemon exits — the cleanup assertion must not require unlink-while-open semantics there (#96731 follow-up, Windows verification report).
This commit is contained in:
@@ -352,8 +352,12 @@ class TestAgentBrowserCliCapture:
|
||||
# Pipe capture would stall here for the full 15s timeout on POSIX and
|
||||
# hang past the outer tool deadline on Windows.
|
||||
assert elapsed < 10, f"get cdp-url stalled {elapsed:.1f}s behind a grandchild"
|
||||
# The capture temp files are cleaned up after the call.
|
||||
assert not list(tmp_path.glob("_std*_rp-*"))
|
||||
# The capture temp files are cleaned up after the call. POSIX unlinks
|
||||
# files a live grandchild still holds open; on Windows the daemon's
|
||||
# inherited handles keep them until it exits, and the unlink is
|
||||
# best-effort by design (_unlink_command_output_files swallows OSError).
|
||||
if sys.platform != "win32":
|
||||
assert not list(tmp_path.glob("_std*_rp-*"))
|
||||
|
||||
def test_capture_cli_surfaces_stdout_stderr_and_exit_code(self, tmp_path):
|
||||
import sys
|
||||
|
||||
Reference in New Issue
Block a user