From b83865a65eb744f6d36c1c672a4d83a59d6383f8 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 5 May 2026 09:37:12 -0500 Subject: fix(ci): rewrite mode-init-order test and retry deps install Two CI failures from the first run, neither a real bug in production code. The Emacs-snapshot job failed on `test-wttrin-mode-initialization-order-normal-mode-before-buffer-local-vars-calls-mode-first`. The original test mocked the `set' primitive to detect when `xterm-color--state' was first set. That worked on the byte-code path some older Emacs versions used, but `setq-local' doesn't go through the `set' function on Emacs master, so the mock never fired and the assertion read nil. The test was already brittle in isolation locally too. Rewrote the test to use `advice-add :before' on `wttrin-mode' and `make-local-variable'. Both are ordinary advisable functions, and `make-local-variable' is on the code path for every form that defines a buffer-local binding (`setq-local', `defvar-local', etc.) so the observation holds across Emacs versions. Renamed the test to drop "calls-mode-first" and use "mode-runs-before-xterm-color-state-binding" since that's what the new advice actually observes. The Emacs 26.3 job failed with a transient DNS error from elpa.gnu.org during `make deps'. Wrapped the install step in a 3-attempt retry with a 15-second backoff so a runner-side network blip doesn't fail the build. Applied to all three jobs (test, lint, coverage) since they all hit the same archives. --- .github/workflows/ci.yml | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4876c76..d8fa309 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,18 @@ jobs: version: 'snapshot' - name: Install dependencies - run: make deps + run: | + for attempt in 1 2 3; do + if make deps; then + exit 0 + fi + if [ "$attempt" -lt 3 ]; then + echo "::warning::deps install attempt $attempt failed, retrying in 15s" + sleep 15 + fi + done + echo "::error::deps install failed after 3 attempts" + exit 1 - name: Run tests run: make test @@ -55,7 +66,18 @@ jobs: version: 'snapshot' - name: Install dependencies - run: make deps + run: | + for attempt in 1 2 3; do + if make deps; then + exit 0 + fi + if [ "$attempt" -lt 3 ]; then + echo "::warning::deps install attempt $attempt failed, retrying in 15s" + sleep 15 + fi + done + echo "::error::deps install failed after 3 attempts" + exit 1 - name: Run linters run: make lint @@ -77,7 +99,18 @@ jobs: version: 'snapshot' - name: Install dependencies - run: make deps + run: | + for attempt in 1 2 3; do + if make deps; then + exit 0 + fi + if [ "$attempt" -lt 3 ]; then + echo "::warning::deps install attempt $attempt failed, retrying in 15s" + sleep 15 + fi + done + echo "::error::deps install failed after 3 attempts" + exit 1 - name: Run coverage run: make coverage -- cgit v1.2.3