Skip to content

fix(tests): remove two xfail markers left by the parity merge (route-aware fast-mode + deterministic MoA parallelism) - #426

Merged
Kyzcreig merged 2 commits into
mainfrom
fix/xfail-removals
Jul 26, 2026
Merged

Kyzcreig merged 2 commits into
mainfrom
fix/xfail-removals

Conversation

@Kyzcreig

Copy link
Copy Markdown
Collaborator

Closes the two documented xfails from PR #420.

t_05fcd58f — route-aware fast-mode adoption. test_fast_route_capability is an AST enforcement test demanding every request-enforcement call site use the route-aware resolve_fast_mode_capability() rather than the model-only wrapper. It had been red on fork/main since before the merge (latent debt — verified identical on baseline 37fa0a353). Call sites converged, preserving model-only-route behavior; marker deleted.

t_78a2fa21 — deterministic parallelism proof. test_references_run_in_parallel proved concurrency with a wall-clock stopwatch, which flips under CI's 12-worker parallelism when the scheduler serializes coroutines. Replaced with an overlap assertion inside call_llm. RED-proved: forcing workers=1 yields references never overlapped inside call_llm instead of silently passing.

Verification (mine, re-run independently of the worker): 93 passed across both files. Worker's canonical-runner sweep: 246 tests / 7 files green, 0 xfail markers remaining, ruff clean.

Not upstreamable — both patches target fork-only regions of slash_commands.py/models.py (verified: git apply --check fails against origin/main).

Route-aware fast-mode call-site adoption (card t_05fcd58f): converge the
remaining request-enforcement call sites onto resolve_fast_mode_capability()
instead of the model-only model_supports_fast_mode() wrapper, preserving
model-only-route behavior (a widening, not a behavior change). Removes the
xfail on tests/cli/test_fast_route_capability.py, which had been red on
fork/main since before the merge (latent debt, not merge damage).

Deterministic MoA parallelism proof (card t_78a2fa21): test_references_run_in_parallel
proved concurrency with a wall-clock stopwatch, which flips under CI's 12-worker
parallelism when the scheduler serializes the coroutines. Replaced with an
overlap assertion inside call_llm that fails deterministically on serialization.
RED-proved: forcing workers=1 yields 'references never overlapped inside
call_llm' instead of passing.

246 tests green across 7 files under the canonical runner; 0 xfail markers
remain in either file; ruff clean.
@Kyzcreig

Copy link
Copy Markdown
Collaborator Author

FleetReview

Confidence: 3/5

Findings

  • P1 hermes_cli/models.py:2543 — Route Misclassification
  • P1 gateway/slash_commands.py:3950 — The picker validates the global route instead of the active session route

FleetReview provenance · models: B=gpt-5.6-sol, C=claude-code-opus-4-8, F=gpt-5.6-sol, G=grok-4.5 · cost: $10.86 · duration: 8m 56s · rounds: 1 · files examined: 5

@Kyzcreig
Kyzcreig enabled auto-merge (squash) July 26, 2026 03:33
@Kyzcreig
Kyzcreig merged commit bab5061 into main Jul 26, 2026
40 checks passed
@Kyzcreig
Kyzcreig deleted the fix/xfail-removals branch July 26, 2026 03:42
Kyzcreig added a commit that referenced this pull request Jul 27, 2026
…kes) (#438)

Three wall-clock flakes hit in a single day. They share one defect: the test
proves a CONCURRENCY or NON-BLOCKING property by measuring elapsed real time,
which makes the OS scheduler part of the assertion. Under load the inequality
flips with nothing wrong in the code under test.

The worst one blocked the merge queue: tests/gateway/test_session_hygiene.py
failed `assert elapsed < 2.0` with 2.005265276999978 -- five milliseconds --
while sitting at the head of a queue for a PR touching zero gateway files.

Profiling that test shows the bound was not even measuring the behavior it
protects: ~1.5s of the 2.3s window is models_dev.fetch_models_dev ->
_save_disk_cache -> atomic_json_write (~600k json-encoder calls), i.e. one-time
provider-metadata cache work. Instrumented runs on an IDLE box measured 1.40s,
1.87s and 2.39s -- the 2.0 threshold sits inside the natural distribution, so
the failure was not an outlier.

This applies the pattern from #426 (barrier, not stopwatch) to the rest of the
family:

- tests/gateway/test_session_hygiene.py -- ordering witness: an Event set in a
  finally on every worker exit path, asserted UNSET when the handler returns.
- tests/agent/test_context_refs_concurrent.py -- asyncio.Barrier(3): all three
  @url: fetches must be in flight at once before any may return.
- tests/tools/test_mcp_tool.py -- threading.Barrier(3) for parallel shutdown.
- tests/plugins/memory/test_mem0_rerank_guard.py -- alert_returned witness
  replaces `elapsed < 0.1` across a 16-thread pool.
- tests/agent/test_memory_boundary_commit.py -- assert the provider recorded
  NOTHING yet, proving /new was not gated on the slow extraction.

Every conversion keeps a finite barrier/wait timeout (10-30s) so a genuine
regression fails fast instead of hanging, but that is orders of magnitude above
real rendezvous latency, so it is not itself a timing assertion.

RED-PROVEN: each was verified by breaking the behavior it protects and
confirming the new assertion fails by name -- removing the wait_for timeout
wiring, replacing asyncio.gather with a serial loop (x2), making observe() join
the alert thread, and running the boundary commit inline (the pre-NousResearch#16454
blocking bug). Two of the five first drafts could NOT fail and were caught and
strengthened by that exercise. All source mutations reverted; this diff is
test-only.

Side effect: the barrier forms delete fixed sleeps, so test_mcp_tool shutdown
drops ~1s -> ~0.1s and the mem0 rerank test 7.0s -> 1.7s.

Deliberately NOT changed: hang-guards. `assert ev.wait(timeout=5)` asserts the
EVENT, not the duration; lower bounds like `assert elapsed >= 0.04` prove an
injected wait happened and get MORE reliable under load; and ceilings an order
of magnitude above the hang they guard fail only on real regressions. The rule
applied: convert when load can cause failure, leave alone when only a real
regression can.

Co-authored-by: Kyzcreig <9063726+Kyzcreig@users.noreply.github.com>
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.

1 participant