Skip to content

Commit 972d7e2

Browse files
committed
Harden the CI smoke fixture on macOS
1 parent 6031215 commit 972d7e2

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ All notable changes to `devloop` will be recorded in this file.
66

77
### Fixed
88
- Made the CI smoke test wait for file watching to start before editing
9-
the watched fixture file, avoiding a startup race that could time out
10-
on macOS runners.
9+
the watched fixture file, and retry the watched write until the state
10+
change is observed, avoiding startup races on macOS runners.
1111

1212
### Changed
1313
- Split Linux and macOS CI into separate badgeable workflows backed by

scripts/ci-smoke.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,22 @@ while time.time() < deadline:
5858
raise SystemExit("timed out waiting for watcher startup")
5959
PY
6060

61-
printf 'updated\n' > "${tmp_dir}/watched.txt"
62-
63-
python3 - "$state_path" "$log_path" <<'PY'
61+
python3 - "$state_path" "$log_path" "${tmp_dir}/watched.txt" <<'PY'
6462
import json
6563
import pathlib
6664
import sys
6765
import time
6866
6967
state_path = pathlib.Path(sys.argv[1])
7068
log_path = pathlib.Path(sys.argv[2])
69+
watched_path = pathlib.Path(sys.argv[3])
7170
deadline = time.time() + 15
71+
next_write = 0.0
7272
while time.time() < deadline:
73+
now = time.time()
74+
if now >= next_write:
75+
watched_path.write_text("updated\n")
76+
next_write = now + 0.5
7377
if state_path.exists():
7478
data = json.loads(state_path.read_text())
7579
if (

0 commit comments

Comments
 (0)