Skip to content

Commit 569c4dd

Browse files
committed
ci(s001): the cold-start timer used a GNU date extension and died on macOS
`date +%s%3N` is GNU-only. BSD date on the macOS runner emitted "17887458973N" and the arithmetic failed with "value too great for base". python3 is on all three runner images and gives the same number everywhere. Linux passed the same step in the same run — COLD_START_MS=590, HTTP 200 on port 33395 — so the timer works and only its portability was wrong. Third defect this workflow's runs have surfaced that no local run could have: the first two were the sidecar's Tauri name and the per-environment deps.get on Windows. mix gate exit=0. Signed-off-by: Ayla Croft <aylacroft@proton.me>
1 parent a22687e commit 569c4dd

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎.github/workflows/package.yml‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,11 @@ jobs:
185185
shell: bash
186186
run: |
187187
set -euo pipefail
188-
start=$(date +%s%3N)
188+
# `date +%s%3N` is a GNU extension: BSD date on the macOS runner emitted
189+
# "17887458973N" and the arithmetic died with "value too great for base". python3 is
190+
# present on all three runner images and gives the same number everywhere.
191+
now_ms() { python3 -c 'import time;print(int(time.time()*1000))'; }
192+
start=$(now_ms)
189193
PHX_SERVER=true "./burrito_out/${{ matrix.artifact }}" --no-halt > serve.log 2>&1 &
190194
PID=$!
191195
for _ in $(seq 1 240); do
@@ -195,7 +199,7 @@ jobs:
195199
done
196200
test -n "${PORT:-}"
197201
until curl -sS -o /dev/null "http://127.0.0.1:$PORT/" 2>/dev/null; do sleep 0.05; done
198-
elapsed=$(( $(date +%s%3N) - start ))
202+
elapsed=$(( $(now_ms) - start ))
199203
code=$(curl -sS -o /dev/null -w '%{http_code}' "http://127.0.0.1:$PORT/")
200204
echo "HTTP $code on port $PORT"
201205
echo "COLD_START_MS=$elapsed" | tee -a "$GITHUB_ENV"

0 commit comments

Comments
 (0)