Commit graph

7 commits

Author SHA1 Message Date
Trevon
d11da7e29e
test(p2p_mesh): per-node CPU/memory limits and an idle CPU sampler (#292)
The mesh harness ran nodes with the build host's resources, so a daemon
that pins a small machine's CPU while idle never showed up. `up` and `run`
take --cpus and --memory (docker cpus/mem_limit per node). The new `idle`
command samples docker stats with no client traffic, writes idle.csv and
idle.json, optionally captures top -H of the hottest node, and exits 5
when a node's mean CPU exceeds --max-cpu.

Local/manual tooling; nothing runs in CI.

Signed-off-by: trvon <me@trevon.dev>
2026-10-14 08:32:55 -06:00
trvon
30206e6683
test(p2p): require an explicit zero from every node to pass drain checks
The deferred-drain check treated a missing value as zero, so a node
whose p2p status call failed or returned non-JSON satisfied it. Drain
now needs a numeric 0 from every node, and so does the quarantined
writer check once any node reports the field; an unreadable status is
reported as such instead of passing.

Signed-off-by: trvon <me@trevon.dev>
2026-10-01 12:20:28 -06:00
trvon
6656485682
test(p2p): report hashes that failed the read-path check as unreadable
converge proves convergence with yams get once yams list shows every
hash. When those reads kept failing until the timeout, the listing gap
was empty, so converge.json and REPORT.md claimed every document was
readable next to converged=false. The final yams get failures are now
kept (unreadable_via_get) and used for the readable counts whenever the
read-path check ran.

Signed-off-by: trvon <me@trevon.dev>
2026-10-01 12:20:27 -06:00
trvon
147420aa2e
test(p2p): seed exactly --docs-per-node documents per node
seed floored --docs-per-node to whole rounds of topics: 10 documents
with 8 topics seeded 8, 0 still seeded a full round, and --topics 0
raised ZeroDivisionError. Both counts are now validated, and the last
round is truncated so every node gets exactly the requested number.

Signed-off-by: trvon <me@trevon.dev>
2026-10-01 12:20:27 -06:00
trvon
20a05a7da0
test(p2p): tear down the previous mesh on a forced up
up --force only skipped the existing-state guard. Compose then recreated
the services on the old named volumes, so nodes came up with the stale
/node/ready marker, keys and config of the previous mesh, and services
of a larger previous mesh kept running as orphans. A forced up now runs
down (volumes, orphans, image) for the previous project first and starts
under a fresh project name.

Signed-off-by: trvon <me@trevon.dev>
2026-10-01 12:20:27 -06:00
trvon
16b7adf62f
test(p2p): fail mesh convergence on quarantined writers, isolate runs
A mesh of honest writers must never durably quarantine one of them, but
converge only checked document reachability and deferral drain, so a run
that quarantined a peer could still pass. converge now records
quarantined_writers per node and exits 4 when any node reports one.

Every up/run also gets its own compose project (yamsmesh-<random>, or
--project), so containers, network, volumes and image tag of concurrent
meshes on one host no longer collide.

Signed-off-by: trvon <me@trevon.dev>
2026-10-01 12:20:27 -06:00
trvon
69b8bdcd54
test(p2p): add docker mesh harness for N-node direct memory-sync convergence
Production meshes (transport=direct, full mesh, operator-pinned mutual TLS)
stalled at a fixed record count with failed_cycles=0 because a failed inbound
apply stage skipped the node's own publish. Reproducing that needs several
real daemons with enrolled pins and a corpus of embeddings and topology
edges authored on different nodes, so add tests/integration/p2p_mesh:

- Dockerfile and node entrypoint that run prebuilt yams/yams-daemon from a
  host build dir or a released .deb, one isolated volume per node.
- mesh.py (stdlib only) with up/seed/converge/status/chaos/run/down. It
  generates writer keys and manifests, enrolls every peer pin and connects
  a full mesh the way an operator does, and records apply-health counters
  when the build reports them.

Local/manual tooling only; not wired into any CI.

Signed-off-by: trvon <me@trevon.dev>
2026-10-01 12:20:26 -06:00