Skip to content

test(daemon): synthetic burst-link reproducer for #726 (closes #729) - #733

Merged
zackees merged 1 commit into
mainfrom
test/729-burst-link-reproducer
Jun 14, 2026
Merged

zackees merged 1 commit into
mainfrom
test/729-burst-link-reproducer

Conversation

@zackees

@zackees zackees commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a self-contained burst-load regression test for the #726 wedge class so it does not depend on FastLED running on the runner. Closes #729.

Two tests in crates/zccache/tests/daemon_burst_link_test.rs:

  1. burst_compile_does_not_wedge_daemon (`#[ignore]`, integration). Fires N=200 concurrent `Request::Compile` invocations against one fresh `DaemonServer`. Asserts all complete, the daemon answers a follow-up `Ping` on a fresh connection, and the wall time stays under the 60s budget from test: synthetic ninja burst-link reproducer for #726 daemon graceful-shutdown under high concurrent link #729. No-ops when clang is not on PATH, matching the existing `daemon_stress_test.rs` pattern, so it joins the default integration suite. Burst width is tunable via `ZCCACHE_BURST_N`.

  2. `wedge_budget_default_survives_burst_window` (always-on). Documents the invariant the burst test depends on — the default wedge recv budget (fix(wedge): widen wedge budget + dedupe shutdown log under burst link load (#726) #727's 90s → 180s widening) must stay ≥ 150s, otherwise the burst test will flake on slow runners. Probes the env-var contract `ZCCACHE_WEDGE_RECV_TIMEOUT_SECS` rather than the private constant.

Local validation

N Wall time Budget Result
50 5.8s 60s pass
200 26.0s 60s pass

Scope clarification

This test catches daemon-side regressions that would cause the wedge guard to fire (worker starvation, lock-held I/O like #724, persist-pool saturation). The guard's own CLI-side logic is still covered by the existing `wedge_detection_*` unit tests in `crates/zccache/src/cli/commands/wrap/ipc.rs`.

Test plan

  • `soldr cargo fmt --all`
  • `soldr cargo clippy -p zccache --tests -- -D warnings` — clean
  • `soldr cargo test -p zccache --test daemon_burst_link_test wedge_budget_default` — passes
  • `ZCCACHE_BURST_N=50 soldr cargo test -p zccache --test daemon_burst_link_test burst_compile_does_not_wedge_daemon -- --ignored` — passes in 5.8s
  • `soldr cargo test -p zccache --test daemon_burst_link_test burst_compile_does_not_wedge_daemon -- --ignored` (N=200 default) — passes in 26.0s

Closes #729.

🤖 Generated with Claude Code

Adds `crates/zccache/tests/daemon_burst_link_test.rs` so the #726 wedge
class is regression-testable without depending on FastLED on a runner.
Two tests:

- `burst_compile_does_not_wedge_daemon` (#[ignore], integration): fires
  N=200 concurrent `Request::Compile` invocations against a single
  fresh DaemonServer. Asserts all complete, the daemon answers a
  follow-up Ping on a fresh connection, and the wall time stays under
  the 60 s budget from #729. Verified locally: N=50 → 5.8 s, N=200 →
  26.0 s. Tunable via `ZCCACHE_BURST_N`. No-ops when clang is not on
  PATH, matching the existing `daemon_stress_test.rs` pattern, so it
  joins the standard integration suite.

- `wedge_budget_default_survives_burst_window`: documents the invariant
  the burst test relies on — the default wedge recv budget (#727's
  90 s → 180 s widening) must stay ≥ 150 s, otherwise the burst test
  will flake on slow runners. Probes the env-var contract
  (`ZCCACHE_WEDGE_RECV_TIMEOUT_SECS`) rather than the private constant.

This test catches **daemon-side** regressions that would cause the
wedge guard to fire. The guard's own CLI-side logic is still covered
by the `wedge_detection_*` unit tests in
`crates/zccache/src/cli/commands/wrap/ipc.rs`.

Closes #729.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@zackees
zackees merged commit 3eae627 into main Jun 14, 2026
26 checks passed
@zackees
zackees deleted the test/729-burst-link-reproducer branch June 14, 2026 10:19
zackees added a commit that referenced this pull request Jun 14, 2026
Ships four PRs that landed on top of 1.12.2:

- #730 — test(wedge): deterministic `wedge_detection_returns_wedged_on_recv_timeout`
- #731 — diagnostics(persist): enrich the `os error 2` WARN with src/dst/errno/exists/size/gap_ms (#728 criterion 1)
- #732 — fix(meson): allowlist configure outputs, skip-persist on no-op, purge meson-configure on clear (closes #710, KEY_DOMAIN_TAG v2->v3)
- #733 — test(daemon): synthetic burst-link reproducer for #726 (closes #729)

Closes #710, #729 (already closed on merge); ships the #728/#731 diagnostics so the next FastLED `all-with-examples` repro can capture rich logs for criteria #2–#3.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
zackees added a commit that referenced this pull request Jun 14, 2026
Adds `crates/zccache/tests/daemon_spawn_storm_test.rs` so the #691
spawn-storm class becomes regression-testable without depending on a
heavy parallel rustc workload on a runner. One test:

- `parallel_wrappers_must_share_one_daemon` (#[ignore], integration):
  fires N=16 (tunable via ZCCACHE_SPAWN_STORM_N) parallel zccache
  wrapper invocations against a fresh ZCCACHE_CACHE_DIR, sync'd on a
  std::sync::Barrier so they race the daemon-spawn decision together.
  Asserts exactly one daemon-spawn-*.log lands in logs/ and exactly
  one event:"spawn" line lands in daemon-lifecycle.log. This is the
  invariant the coordination fix from #691 should establish.

Gated on ZCCACHE_RUN_REPRO_691=1 in addition to #[ignore], so it is
a no-op under both `cargo test` (unit) and `cargo test -- --ignored`
(./test --integration). Opt in with:

    ZCCACHE_RUN_REPRO_691=1 ./test --integration -- daemon_spawn_storm

On main today the test is expected to FAIL — multiple spawn-attempt
events fire in the racing window before the post-spawn dedup (#640)
catches them, and on loaded runners multiple spawn events can land.
Once the spawn-coordination fix lands, drop the env-var gate so the
test joins the standard integration suite as a permanent regression.

Modeled on cli_single_daemon_per_session.rs (#323 regression test;
same helpers, same log-inspection pattern) and on the synthetic
daemon_burst_link_test.rs precedent from #729 / #733.

Refs #691.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: synthetic ninja burst-link reproducer for #726 daemon graceful-shutdown under high concurrent link

1 participant