Remove wall-clock flakes from the peer evidence CI tests #165

Closed
opened 2026-11-03 10:21:48 +00:00 by svc-agent-writer · 2 comments

Problem

Two wall-clock bounds in tests/test_peer_evidence.py fail CI under runner load. In both cases the PR did not touch the code under test.

  1. tests/test_peer_evidence.py:831 asserts health p99 ≤ 500 ms during a concurrent evidence load. On the shared Woodpecker runner it measured 757.95 ms. That failed PR #164's validation (pipeline 22), although the PR changed docs only. The same commit's parent passed on main (pipeline 21), so the failure depends on runner load.
  2. test_full_cap_pathological_bodies_finish_and_cancel_under_one_second[forward] (tests/test_peer_evidence.py:423) asserts that evidence.signatures_bounded finishes a 512,000-byte pathological body in under 1 s. On the runner it took 1.055 s. That failed PR #168's validation (pipeline 27); PR #168 does not touch evidence.py. The next pipeline (28) passed, and the six parametrized cases passed 5 of 5 runs on voyager, about 1.9 s per run of all six.

Change

  1. :831: keep the concurrent loop and its correctness assertions: valid responses, no non-200 health response, sample counts met. Remove the latency bound from the CI test. Latency budgets are measured on the host by the benchmark scripts, as ADR 0012 rule 14 and the #160 gate ruled for scripts/bench_feed.py.
  2. :423: this bound guards bounded work (#151), not latency, so do not remove it. A regression to super-linear work on a full-cap body takes far longer than a few seconds. Raise both one-second bounds in the test (the finish bound and the cancel bound) to a margin that runner load cannot reach, for example 5 s, and keep every other assertion. Do the same for every parametrized shape.

Acceptance

  • test_peer_evidence.py asserts no latency bound at :831.
  • The :423 test keeps a finish bound and a cancel bound, each with a margin of at least 5× the host time.
  • make check passes.
  • The #151 latency measurement stays reproducible on the host, either through an existing benchmark script or through a documented command in the PR.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com

## Problem Two wall-clock bounds in `tests/test_peer_evidence.py` fail CI under runner load. In both cases the PR did not touch the code under test. 1. `tests/test_peer_evidence.py:831` asserts health p99 ≤ 500 ms during a concurrent evidence load. On the shared Woodpecker runner it measured 757.95 ms. That failed PR #164's validation (pipeline 22), although the PR changed docs only. The same commit's parent passed on `main` (pipeline 21), so the failure depends on runner load. 2. `test_full_cap_pathological_bodies_finish_and_cancel_under_one_second[forward]` (`tests/test_peer_evidence.py:423`) asserts that `evidence.signatures_bounded` finishes a 512,000-byte pathological body in under 1 s. On the runner it took 1.055 s. That failed PR #168's validation (pipeline 27); PR #168 does not touch `evidence.py`. The next pipeline (28) passed, and the six parametrized cases passed 5 of 5 runs on `voyager`, about 1.9 s per run of all six. ## Change 1. `:831`: keep the concurrent loop and its correctness assertions: valid responses, no non-200 health response, sample counts met. Remove the latency bound from the CI test. Latency budgets are measured on the host by the benchmark scripts, as ADR 0012 rule 14 and the #160 gate ruled for `scripts/bench_feed.py`. 2. `:423`: this bound guards bounded work (#151), not latency, so do not remove it. A regression to super-linear work on a full-cap body takes far longer than a few seconds. Raise both one-second bounds in the test (the finish bound and the cancel bound) to a margin that runner load cannot reach, for example 5 s, and keep every other assertion. Do the same for every parametrized shape. ## Acceptance - `test_peer_evidence.py` asserts no latency bound at `:831`. - The `:423` test keeps a finish bound and a cancel bound, each with a margin of at least 5× the host time. - `make check` passes. - The #151 latency measurement stays reproducible on the host, either through an existing benchmark script or through a documented command in the PR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
svc-agent-writer changed title from Remove the latency bound from the peer evidence CI load test to Remove wall-clock flakes from the peer evidence CI tests 2026-11-03 11:47:13 +00:00
Collaborator

⏸ SVD architect gate: dev/mail-mind-mcp#165 remove-wall-clock-flakes-from-the-peer-evidence-ci-tests

Status: CLEAN after 0 rework round(s) · 0 blocking defect(s) · 0 lens(es) INCONCLUSIVE (could not run) · 0 lens(es) DEGRADED (deterministic denial) · complexity additive · dispatch effort low

Run: 20261103T214715Z-dff7e21d

Held because: CLEAN but 3 open risk(s) (2 verification · 1 decision) — HOLD-ALL parks everything. The risks, verbatim:

Open risks:

  1. tests/test_peer_evidence.py has other wall-clock bounds the issue does not name: :352 (0.035 <= elapsed < 0.5), :400/407/408, :508-514, :749-753 and :934-939, all 1 s or less. They are left unchanged to stay in scope. Question for the architect: file a follow-up issue to give these the same treatment before they flake on the shared runner? [decision]
  2. The >= 5x host-time margin rests on the issue's reported ~1.9 s for all six shapes on voyager; the sandbox could not execute the venv to measure. Check: on the host, run uv run python3 -m pytest -q --durations=0 tests/test_peer_evidence.py -k pathological and confirm the slowest per-shape duration is <= 1 s (so 5 s >= 5x), and record it in the PR. [verification]
  3. make check (including the network audit step) could not run in the sandbox. Check: the dispatch agent runs make check on the host and the Woodpecker validation pipeline is green on the PR. [verification]

Change: Change one file, tests/test_peer_evidence.py. (1) In test_i02_writer_evidence_and_health_load (:760-841), make the I02 test look like tests/test_peer_changes.py:517-547 test_i02_feed_and_health_smoke: change :840 to assert report["non_200"] == 0, which drops the health p99 <= 500 ms term. Keep the loops, the correctness asserts (:797, :838-839), the RSS bound (:841) and the print("I02 " + json.dumps(report)) at :837. Rewrite the :761 docstring to say latency budgets are measured on the host (ADR 0012 rule 14), and give the host reproduction command uv run python3 -m pytest -s tests/test_peer_evidence.py::test_i02_writer_evidence_and_health_load. (2) Add a module constant BOUNDED_WORK_SECONDS = 5 after ARGS (:31), with a comment saying it guards bounded work (#151), not latency. In the pathological-body test (:412-449), replace with that constant: the finish bound (:432), the cancel bound (:449), and future.result(timeout=1) at :448. :448 is required because the worker runs a full trim_quoted pass after release (evidence.py:77-79), so timeout=1 is the real cancel deadline. Also replace the entered.wait(1) and release.wait(1) synchronization waits (:443, :436). Keep every other assertion and all six shapes. Rename the test to test_full_cap_pathological_bodies_finish_and_cancel_bounded; it has no other in-repo references. The issue cites :831 and :423, but the code is now at :840 and :413/:432/:449 (line drift); target the tests by name.

Files: tests/test_peer_evidence.py

Decision: accept the 3 open risk(s) above and dispatch this spec (svd:go), or park (svd:skip) / re-spec (svd:respec)?

Your call (when this issue is held at the gate via svd:hold):

  • add label svd:go — approve; Half-B dispatch accepts exactly this spec (open risks accepted)
  • add label svd:fire beside svd:go — approve AND authorise the Half-B fire from the phone; never on its own
  • add label svd:skip — park it; dispatch refuses it and the issue stays for a human
  • add label svd:respec — discard this spec; the next Half-A run re-produces it with this record as prior-attempt context

Spec: /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-03-remove-wall-clock-flakes-from-the-peer-evidence-ci-tests.md — next: codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-03-remove-wall-clock-flakes-from-the-peer-evidence-ci-tests.md

### ⏸ SVD architect gate: dev/mail-mind-mcp#165 remove-wall-clock-flakes-from-the-peer-evidence-ci-tests **Status:** CLEAN after 0 rework round(s) · 0 blocking defect(s) · 0 lens(es) INCONCLUSIVE (could not run) · 0 lens(es) DEGRADED (deterministic denial) · complexity `additive` · dispatch effort `low` **Run:** `20261103T214715Z-dff7e21d` **Held because:** CLEAN but 3 open risk(s) (2 verification · 1 decision) — HOLD-ALL parks everything. The risks, verbatim: **Open risks:** 1. tests/test_peer_evidence.py has other wall-clock bounds the issue does not name: :352 (0.035 <= elapsed < 0.5), :400/407/408, :508-514, :749-753 and :934-939, all 1 s or less. They are left unchanged to stay in scope. Question for the architect: file a follow-up issue to give these the same treatment before they flake on the shared runner? [decision] 2. The >= 5x host-time margin rests on the issue's reported ~1.9 s for all six shapes on voyager; the sandbox could not execute the venv to measure. Check: on the host, run `uv run python3 -m pytest -q --durations=0 tests/test_peer_evidence.py -k pathological` and confirm the slowest per-shape duration is <= 1 s (so 5 s >= 5x), and record it in the PR. [verification] 3. `make check` (including the network audit step) could not run in the sandbox. Check: the dispatch agent runs `make check` on the host and the Woodpecker validation pipeline is green on the PR. [verification] **Change:** Change one file, tests/test_peer_evidence.py. (1) In test_i02_writer_evidence_and_health_load (:760-841), make the I02 test look like tests/test_peer_changes.py:517-547 test_i02_feed_and_health_smoke: change :840 to `assert report["non_200"] == 0`, which drops the health p99 <= 500 ms term. Keep the loops, the correctness asserts (:797, :838-839), the RSS bound (:841) and the `print("I02 " + json.dumps(report))` at :837. Rewrite the :761 docstring to say latency budgets are measured on the host (ADR 0012 rule 14), and give the host reproduction command `uv run python3 -m pytest -s tests/test_peer_evidence.py::test_i02_writer_evidence_and_health_load`. (2) Add a module constant BOUNDED_WORK_SECONDS = 5 after ARGS (:31), with a comment saying it guards bounded work (#151), not latency. In the pathological-body test (:412-449), replace with that constant: the finish bound (:432), the cancel bound (:449), and future.result(timeout=1) at :448. :448 is required because the worker runs a full trim_quoted pass after release (evidence.py:77-79), so timeout=1 is the real cancel deadline. Also replace the entered.wait(1) and release.wait(1) synchronization waits (:443, :436). Keep every other assertion and all six shapes. Rename the test to test_full_cap_pathological_bodies_finish_and_cancel_bounded; it has no other in-repo references. The issue cites :831 and :423, but the code is now at :840 and :413/:432/:449 (line drift); target the tests by name. **Files:** `tests/test_peer_evidence.py` **Decision:** accept the 3 open risk(s) above and dispatch this spec (`svd:go`), or park (`svd:skip`) / re-spec (`svd:respec`)? **Your call** (when this issue is held at the gate via `svd:hold`): - add label `svd:go` — approve; Half-B dispatch accepts exactly this spec (open risks accepted) - add label `svd:fire` **beside** `svd:go` — approve AND authorise the Half-B fire from the phone; never on its own - add label `svd:skip` — park it; dispatch refuses it and the issue stays for a human - add label `svd:respec` — discard this spec; the next Half-A run re-produces it with this record as prior-attempt context <sub>Spec: `/Users/piers/.local/state/exhaust/groupthink/specs/2026-11-03-remove-wall-clock-flakes-from-the-peer-evidence-ci-tests.md` — next: `codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-03-remove-wall-clock-flakes-from-the-peer-evidence-ci-tests.md`</sub>
Collaborator

spec-verify-dispatch Half B for dev/mail-mind-mcp#165 remove-wall-clock-flakes-from-the-peer-evidence-ci-tests completed integration verify.

  • PR: #173
  • Branch: feat/svd-dev-mail-mind-mcp-165-remove-wall-clock-flakes-from-43ed258b
  • Commit: 790c89673b
  • Build: none
  • Test: green
  • Reader audit clean: True
  • Spec fidelity: True
  • Ready for merge: True
  • Check ci/woodpecker/pr/validation: green https://ci.groupthink.asia/repos/72/pipeline/38/1
  • Checks: required ci/woodpecker/pr/validation resolved pass by CI-wait poll
  • Warning: The PR body trailer reads 'Co-Authored-By: gpt-6.1-sol'. This is cosmetic.
  • Warning: Other wall-clock bounds in tests/test_peer_evidence.py stay unchanged by decision. A follow-up issue tracks them.
  • Warning: I did not run make check. The PR body reports it passing.
  • CI wait: ci/woodpecker/pr/validation -> pass
  • Decision: review the PR and merge? (codex-svd ship --run-id 20261103T220218Z-43ed258b --confirm-merge)
spec-verify-dispatch Half B for dev/mail-mind-mcp#165 remove-wall-clock-flakes-from-the-peer-evidence-ci-tests completed integration verify. - PR: https://git.groupthink.asia/dev/mail-mind-mcp/pulls/173 - Branch: feat/svd-dev-mail-mind-mcp-165-remove-wall-clock-flakes-from-43ed258b - Commit: 790c89673bf502771fc656a5095c3d53bfa7821e - Build: none - Test: green - Reader audit clean: True - Spec fidelity: True - Ready for merge: True - Check ci/woodpecker/pr/validation: green https://ci.groupthink.asia/repos/72/pipeline/38/1 - Checks: required ci/woodpecker/pr/validation resolved pass by CI-wait poll - Warning: The PR body trailer reads 'Co-Authored-By: gpt-6.1-sol'. This is cosmetic. - Warning: Other wall-clock bounds in tests/test_peer_evidence.py stay unchanged by decision. A follow-up issue tracks them. - Warning: I did not run make check. The PR body reports it passing. - CI wait: ci/woodpecker/pr/validation -> pass - Decision: review the PR and merge? (`codex-svd ship --run-id 20261103T220218Z-43ed258b --confirm-merge`)
svc-svd-writer 2026-11-03 22:16:02 +00:00
  • closed this issue
  • removed the
    svd:go
    label
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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
dev/mail-mind-mcp#165
No description provided.