Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions tests/test_macos_storage_protection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 3 additions & 1 deletion tests/test_macos_watch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading