diff --git a/tests/test_macos_storage_protection.py b/tests/test_macos_storage_protection.py index d7f6039..c07d50c 100644 --- a/tests/test_macos_storage_protection.py +++ b/tests/test_macos_storage_protection.py @@ -461,18 +461,20 @@ def test_application_metadata_tools_share_total_budget(project_root, tmp_path): plist_tool, mdls_tool, extra_env={ - "PCH_STORAGE_APPLICATION_COMMAND_TIMEOUT": "5", + "PCH_STORAGE_APPLICATION_COMMAND_TIMEOUT": "10", # Bash SECONDS has whole-second resolution. A one-second budget # can expire during fixture validation before the tool launches. # Two seconds gives startup headroom while still proving that the - # shared budget cuts short the five-second command timeout. + # shared budget cuts short the ten-second command timeout. "PCH_STORAGE_APPLICATION_TOTAL_BUDGET": "2", }, ) elapsed = time.monotonic() - started assert result.returncode == 0, result.stderr - assert elapsed < 4 + # Leave scheduling headroom on shared macOS runners while remaining + # below the per-command timeout (10s) and hanging child lifetime (30s). + assert elapsed < 8 assert child_pid.exists(), "the tool must launch to exercise budget cancellation" pid = child_pid.read_text(encoding="utf-8") assert not subprocess.run( diff --git a/tests/test_macos_watch.py b/tests/test_macos_watch.py index 0988652..5c40cf0 100644 --- a/tests/test_macos_watch.py +++ b/tests/test_macos_watch.py @@ -1866,7 +1866,9 @@ def test_storage_watch_notification_deadline_stops_the_entire_process_tree( # Measure the notification deadline from notifier startup. The outer # command also verifies the signed app and collects storage facts, which # can take several seconds on a shared CI host before notification begins. - assert time.time() - child_pid_file.stat().st_mtime < 4 + # The 1s polling deadline also includes process reaping and state writes. + # Keep the bound below the 20s child lifetime without timing CI load. + assert time.time() - child_pid_file.stat().st_mtime < 8 child_pid = int(child_pid_file.read_text(encoding="utf-8").strip()) for _ in range(50): try: