Skip to content

ci(test/windows): reset zccache daemon before test run to mitigate link flake (Closes #2805) - #2806

Merged
zackees merged 2 commits into
masterfrom
fix/windows-zccache-daemon-reset
Jun 5, 2026
Merged

zackees merged 2 commits into
masterfrom
fix/windows-zccache-daemon-reset

Conversation

@zackees

@zackees zackees commented Jun 5, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds a Windows-only `zccache stop || true` step to `template_unit_test.yml` between `./install` and `./test`, mitigating the `unit tests windows` link-flake. Closes #2805.

Final unaddressed badge in the README sweep. The earlier ones: ✅ #2780 (AVR), ✅ #2785 (STM32 GIGA), ✅ #2788 (Apollo3), ⏳ #2793 (RP2040), ⏳ #2800 (AVR8JS), ⏳ #2804 (size budgets).

What's broken

The Windows job is intermittently red — same commit class passes some runs and fails others. The failing runs all show the same signature:

```
FAILED: [code=1] tests/fl_math_trig8.dll
zccache[err][R]: lost connection to daemon (no response).
Often a daemon-CLI protocol version mismatch - try `zccache stop`
```

zccache wraps the linker on Windows. Its named-pipe IPC to the daemon drops mid-link under the heavy ASan-instrumented `-shared` link load that FastLED's per-test DLL fan-out produces. The two test DLLs reported each run (`fl_math_trig8.dll`, `fl_math_transform.dll` this time) aren't consistent across runs — they're just whichever links lose the race to the daemon dropping.

Recent run history confirms the flake pattern (same source class, alternating outcomes):

Time SHA Conclusion
09:10 `787de450d1` ❌ failure
08:50 `5d271671d1` ❌ failure
08:30 `8c87cbfddb` ✅ success
08:17 `a4bdea8458` ❌ failure
07:43 `d471d94356` ❌ failure
07:10 `99ddad4487` ✅ success
06:52 `b5e51c3339` ❌ failure

What this PR changes

One new step in `.github/workflows/template_unit_test.yml`, guarded by `if: runner.os == 'Windows'`:

```yaml

The daemon's own diagnostic explicitly recommends `zccache stop` to recover from the connection-drop class of failures. Starting the Windows job with a known-clean daemon state avoids inheriting whatever the `./install` step's earlier zccache invocations left behind. `|| true` because on a fresh runner there may be no daemon to stop — that's the desired end state anyway.

Linux and macOS jobs are unaffected (the guard skips them).

What this PR is not

This is a mitigation, not a guaranteed cure. True daemon-flake-under-load may still occur. If reds persist, follow-ups should consider:

  • Pinning a known-good zccache version (the recent `a27cbff8d0` bumped to `>=1.11.11`)
  • Running zccache in daemon-less mode on Windows CI
  • Per-job retry on test failure for the Windows runner

Test plan

Pure CI configuration — local `bash test` doesn't exercise hosted-runner daemon behavior. PR CI on `unit tests windows` is the authoritative check, and because the failure is intermittent the signal is statistical: this PR should raise the green-rate from the current ~30% to substantially higher.

`bash lint` clean.

Mandatory code-review trigger

Per global CI rules: modifying CI/CD pipelines is a code-review trigger. Flagged explicitly.

Sweep status

After this lands, every README-listed red badge has either a merged fix or an open PR addressing it.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Improved Windows unit-test reliability by adding a reset step to ensure a clean test daemon state before running tests.
  • Documentation
    • Updated build-system guidance to reflect the new recommended reset command and link to the Windows mitigation guidance.

…nk flake

`unit tests windows` has been intermittently red on master — the same
commit class passes in some runs and fails in others. The failing runs
all show the same signature in the build step:

    FAILED: [code=1] tests/fl_math_trig8.dll
    zccache[err][R]: lost connection to daemon (no response).
        Often a daemon-CLI protocol version mismatch - try `zccache stop`

zccache wraps the linker on Windows; its named-pipe IPC to the daemon
drops mid-link under the heavy ASan-instrumented `-shared` link load
produced by FastLED's per-test DLL fan-out. The two test DLLs reported
each run aren't consistent — they're just whichever links lose the race
to the daemon dropping.

The daemon's own error message recommends `zccache stop` to recover.
Add a Windows-only step before the test run that does exactly that, so
each job starts with a known-clean daemon state instead of inheriting
whatever the install step's invocations left behind.

This is a **mitigation**, not a guaranteed cure for daemon-flake-under-
load. If reds persist after this lands, follow-ups should consider:
pinning a known-good zccache version, running zccache in daemon-less
mode for Windows CI, or per-job retry on test failure. The diagnostic
trail (issue, bisect, mitigation rationale) is in #2805.

CI/CD pipeline change → mandatory code-review trigger per global rules;
flagging explicitly.

Closes #2805

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Jun 5, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4f7ae8fb-10ce-484a-a30b-cd347353c8a7

📥 Commits

Reviewing files that changed from the base of the PR and between bd84bd6 and eb7d12c.

📒 Files selected for processing (1)
  • agents/docs/build-system.md

📝 Walkthrough

Walkthrough

This PR adds a Windows-only step to the unit-test workflow that stops the zccache daemon before tests run and updates build-system docs to recommend zccache stop for resetting the daemon.

Changes

Windows zccache daemon reset

Layer / File(s) Summary
Reset zccache daemon before tests
.github/workflows/template_unit_test.yml, agents/docs/build-system.md
Adds a Windows-only workflow step that runs `zccache stop

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I’m a rabbit in CI land, quick and spry,
I tap the daemon, watch it say goodbye.
Fresh pipes hum as builds commence,
No flaky links to break the sense.
Hoppity tests — success nearby. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly describes the main change: adding a Windows-only zccache daemon reset step to mitigate link flakes, with the issue reference.
Linked Issues check ✅ Passed The PR implements the exact mitigation proposed in issue #2805: adding a Windows-only zccache stop step between install and test, with proper guards and documentation.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the mitigation: the workflow step addition and documentation update referencing the mitigation, with no unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/windows-zccache-daemon-reset

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/template_unit_test.yml:
- Around line 59-71: Update the docs snippet that currently shows the
unsupported command `zccache --stop-server` to the actual working CLI command
used in the workflow (`zccache stop`), or alternatively `zccache daemon stop`;
change the example in agents/docs/build-system.md so the documented command
matches the workflow step that runs `zccache stop || true`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7fa41d27-5519-4b17-a89c-385c58394227

📥 Commits

Reviewing files that changed from the base of the PR and between 787de45 and bd84bd6.

📒 Files selected for processing (1)
  • .github/workflows/template_unit_test.yml

CodeRabbit flagged that `agents/docs/build-system.md` documented
`zccache --stop-server` as the way to reset the daemon, but that flag
is not a supported zccache CLI option. The actual supported command
(also used by the Windows mitigation step in
`.github/workflows/template_unit_test.yml`) is `zccache stop`.

Update the docs snippet so the documented command matches the working
behavior and cross-reference the workflow mitigation.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@zackees
zackees merged commit 069a04e into master Jun 5, 2026
6 checks passed
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jun 5, 2026
@zackees
zackees deleted the fix/windows-zccache-daemon-reset branch August 21, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

broken build: unit tests windows — zccache daemon flakes on Windows runner mid-link

1 participant