Build deterministic replay and isolated integration test tools #32

Merged
Breadway merged 3 commits from fix/ram-29-test-temp-cleanup into main 2026-10-12 09:51:40 +08:00
Owner

Deterministic replay and isolated integration test tools. Closes breadboard RAM-29. Carries the RAM-56 correction.

What this adds

  • crates/breadramd/tests/support/mod.rs: a shared monitor-only daemon owner for the ipc and command_surface suites. It kills and reaps the child on panic, closes inherited pipes, removes its owned socket, and uses a ten-second readiness deadline. Restart tests can explicitly stop while preserving the stale socket.
  • crates/breadramd/tests/ipc.rs and command_surface.rs now use that owner instead of a bare Child, so a panic or readiness timeout can no longer leave a live daemon holding inherited harness pipes.
  • A new unwind regression verifies child disappearance from /proc and socket removal.
  • crates/breadram-core/tests/support/mod.rs: shared deterministic fixtures (snapshot, cgroup_workload, PATH probe, capped-scope runner).
  • crates/breadram-core/tests/support/fake_provider.rs: the in-process fake Ollama loopback service, shared by provider_execution instead of living beside it.
  • crates/breadram-core/tests/support/fake_executor.rs: the scripted coordinator executor with failure injection, shared by action_coordinator instead of living beside it.
  • policy_replay, provider_execution, and action_coordinator all use the shared support.
  • A capped disposable pressure harness: support::capped_scope runs a command in a transient systemd user scope with bounded MemoryMax and MemorySwapMax under a hard timeout; pressure_harness.rs exercises it and skips with a reason when the host cannot run a user scope.
  • Gated hardware reporting: hardware_gate.rs probes for llama-server and vllm and reports, under --nocapture, whether each real-hardware suite can run or is skipped.
  • docs/TESTING.md records the commands, the harness, and the gating.

RAM-56 fix

This branch contains the RAM-56 correction (commit "fix: share bounded daemon test ownership and panic cleanup").

Verification

Run on this branch rebased onto main (2d0965e):

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • cargo build --workspace --locked
  • cargo test --workspace --locked

All pass (24 suites ok), and the suite leaves no temporary directory or live child behind.

Closes RAM-29.

Deterministic replay and isolated integration test tools. Closes breadboard RAM-29. Carries the RAM-56 correction. ## What this adds - crates/breadramd/tests/support/mod.rs: a shared monitor-only daemon owner for the ipc and command_surface suites. It kills and reaps the child on panic, closes inherited pipes, removes its owned socket, and uses a ten-second readiness deadline. Restart tests can explicitly stop while preserving the stale socket. - crates/breadramd/tests/ipc.rs and command_surface.rs now use that owner instead of a bare Child, so a panic or readiness timeout can no longer leave a live daemon holding inherited harness pipes. - A new unwind regression verifies child disappearance from /proc and socket removal. - crates/breadram-core/tests/support/mod.rs: shared deterministic fixtures (snapshot, cgroup_workload, PATH probe, capped-scope runner). - crates/breadram-core/tests/support/fake_provider.rs: the in-process fake Ollama loopback service, shared by provider_execution instead of living beside it. - crates/breadram-core/tests/support/fake_executor.rs: the scripted coordinator executor with failure injection, shared by action_coordinator instead of living beside it. - policy_replay, provider_execution, and action_coordinator all use the shared support. - A capped disposable pressure harness: support::capped_scope runs a command in a transient systemd user scope with bounded MemoryMax and MemorySwapMax under a hard timeout; pressure_harness.rs exercises it and skips with a reason when the host cannot run a user scope. - Gated hardware reporting: hardware_gate.rs probes for llama-server and vllm and reports, under --nocapture, whether each real-hardware suite can run or is skipped. - docs/TESTING.md records the commands, the harness, and the gating. ## RAM-56 fix This branch contains the RAM-56 correction (commit "fix: share bounded daemon test ownership and panic cleanup"). ## Verification Run on this branch rebased onto main (2d0965e): - cargo fmt --all --check - cargo clippy --workspace --all-targets --locked -- -D warnings - cargo build --workspace --locked - cargo test --workspace --locked All pass (24 suites ok), and the suite leaves no temporary directory or live child behind. Closes RAM-29.
fix: share bounded daemon test ownership and panic cleanup
All checks were successful
CPU checks / check (push) Successful in 1m23s
ffa119b45e
test: share core fixtures and add a capped pressure harness
All checks were successful
CPU checks / check (push) Successful in 1m24s
6a8bd30f81
Criterion 1 asked for reusable fixtures shared across the core suites, and
criterion 2 for a capped disposable pressure harness. Both partly land here.

- crates/breadram-core/tests/support/mod.rs holds the shared fixtures: the
  deterministic memory snapshot, the cgroup workload fixture, a PATH probe, and
  the capped-scope runner. policy_replay and provider_execution now use the
  shared snapshot instead of their own copies.
- support::capped_scope runs a command in a transient systemd user scope with a
  bounded MemoryMax and MemorySwapMax under a hard timeout, killing the scope on
  timeout. pressure_harness.rs exercises it and skips with a reason when the host
  cannot run a user scope.
- hardware_gate.rs probes for llama-server and vllm and reports whether each
  real-hardware suite can run or is skipped, so a missing runtime is a reported
  skip rather than a silent pass.
- docs/TESTING.md lists the new commands and states what remains.

Still local to their suites: the in-process fake provider and the action
fixtures. That move is the remaining work on this card.
Breadway force-pushed fix/ram-29-test-temp-cleanup from 6a8bd30f81
All checks were successful
CPU checks / check (push) Successful in 1m24s
to 363bb7f578
All checks were successful
CPU checks / check (push) Successful in 34s
2026-10-12 09:12:50 +08:00
Compare
test: share the fake provider and action fixtures across core suites
All checks were successful
CPU checks / check (push) Successful in 33s
d066544516
Breadway deleted branch fix/ram-29-test-temp-cleanup 2026-10-12 09:51:40 +08:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Breadway/breadram!32
No description provided.