Skip to content

test runner produces false-pass when link fails (zccache daemon crash under all-with-examples) #3011

Closed

Description

@zackees

Summary

When the zccache daemon dies mid-build during the all-with-examples alias target (245 test DLLs + 96 example DLLs linking in parallel), individual tests/<name>.dll link steps fail with lost connection to daemon. The build tool reports FAILED for those targets — but the downstream test runner does NOT treat the missing/stale DLL as a build error. It silently runs whatever .dll is on disk from a previous build, which can produce false test failures (and worse, false test passes in the opposite case).

This was discovered while debugging what looked like 9 audio test failures (fft, audio_reactive, deficiencies, vibe, vocal, beat, audio_processor, detectors, audio). Re-running each test in isolation after the daemon recovered showed all 9 pass. The original "failures" were assertions from stale binaries built before an unrelated math.cpp.hpp edit that prompted the run.

What the log looks like

Detected stale lock 'build:libfastled_build' (dead PIDs: [66680]). Removing...
...
[BUILD] Linking tests...
[BUILD] [6/316] Linking target .build\meson-quick\tests\fl_audio_audio_reactive.dll
...
FAILED: [code=1] tests/fl_audio_audio_reactive.dll
"...\zccache.exe" "...\ctc-clang++.exe" -o tests/fl_audio_audio_reactive.dll ...
zccache[err][R]: lost connection to daemon (no response). The daemon may have crashed
                  or been killed mid-request — run `zccache status` to check, or
                  `zccache stop` then retry to restart it.
[7/316] Linking target tests/fl_audio_url.dll
FAILED: [code=1] tests/fl_audio_url.dll
... (same pattern for 9+ DLLs)

[MESON] Some tests failed (0/0 tests in 92.31s)
[MESON] Test failure details (9 tests): ...
   FAIL: audio::Sample - rms for known signal at ...:405
     ...:420: 500042.64 < 9000.00

Note (0/0 tests in 92.31s) — runner reports zero tests built, but then dumps 9 tests worth of stale assertion output. The disconnect is the bug.

Why it is worse than a noisy log

  1. False-failure direction: wastes investigation time. Stale binary fails new assertions, looks like the diff broke something it did not.
  2. False-pass direction (more dangerous): if the diff would have caused a new assertion failure but the link silently failed, the stale binary passes its old assertions and green-lights a broken change.
  3. Compounds with hooks: the project Stop hook auto-runs tests when a session ends. A spurious failure cascade derails the entire session fix-all-errors recovery loop.

Reproduction

Likely race / load-driven, not 100 % deterministic. Triggers seen:

  • bash test invocation that hits the all-with-examples alias (default for the stop hook)
  • Daemon dies under the parallel-link storm (~245 test DLL link invocations + 96 example DLLs racing against one daemon)
  • Pre-existing stale lock from a prior crashed build (Detected stale lock 'build:libfastled_build') seems to correlate

Environment where observed:

  • Windows 10 Pro 10.0.19045
  • zccache v1.12.1 (protocol v15)
  • clang-tool-chain
  • Build parallelism at host default (16 on this machine)

Suggested fixes (pick one or stack)

  1. Make the test runner fail hard when its DLL is missing or stale. Compare DLL mtime vs the build tool reported success; if the build tool said FAILED for tests/<name>.dll, refuse to run <name>.dll. This is the highest-leverage fix — it stops the false-pass/false-fail behavior independently of the underlying zccache flakiness.
  2. Cap link parallelism for the all-with-examples alias. A pool with depth = 4-8 would dramatically reduce simultaneous daemon-bound link invocations without much wall-time cost (link is fast, the parallel storm is what hurts).
  3. Auto-restart zccache on lost connection to daemon — wrap the linker invocation in a retry-once shim that calls zccache stop and retries when the daemon dies. Lower priority; address root cause instead.

Filed by Claude Code agent ([email protected]) on feat/lpc845-autoresearch-harness. Best-guess defaults; edit the body freely if assumptions are wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions