Skip to content

test(daemon): relay timing test keeps every transfer sending until its windows close (#688) - #901

Merged
V3RON merged 1 commit into
mainfrom
bug/688
Oct 23, 2026
Merged

V3RON merged 1 commit into
mainfrom
bug/688

Conversation

@V3RON

@V3RON V3RON commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Closes #688

The relay timing test sent fixed 64 MiB bodies and probed 500 ms after starting them. On fast hardware the uploads ended before the second after each answer (u0 finished early, CI); on a loaded machine the second before an answer started before the relays moved (u0@…, the local failure in #688). The test checked the timing, not the relay.

Changes, test only (src/daemon/relay-promises.timing.test.ts):

  • Every upload and download body now runs until a second after the last answer, then ends. A body that ends sooner is a cut transfer, still reported as finished early.
  • Probes start 1 s after all 20 relays have carried their first bytes, so both windows lie inside the transfers.
  • The downloads' windows are now checked too: the title always claimed all 20 relays, the body checked only the 10 uploads.

The renew and small-request bounds (1 s) and the 1 MiB per second per relay floor are unchanged.

Status

  • Stability, this file's test alone through the timing project, on a 12-core Mac: 25/25 idle, and 10/10 with 12 busy loops holding every core. Before the fix it failed here 0 of 3 idle runs; the CI failure needs faster hardware.
  • Can fail: ending the bodies just before the probes fails on expected [ 'u0 finished early', …(199) ] to deeply equal [].
  • Whole timing file 9/9; commit hooks (format, lint, comments, boundaries, typecheck) and the push hook green.
  • The cause of flaky: relay-promises timing test fails with 'u0 finished early' on CI #688 was never reproduced; this fix removes the timing assumptions behind both seen failures, so it is a hypothesis until CI stays green.

Assumptions

  • Assumption: the title drops "64 MiB" — the bodies have no fixed size now; the claim is about traffic while the probes run.

Review

Spec review: 0 blocking, 0 fixed, 1 notes. Code review: 0 blocking, 0 fixed, 0 notes. Claims review: 0 blocking, 0 fixed, 0 notes.

Rounds: 1. Tokens: 0.3M.

Round 1, commit f21dc76. The spec lens raised that the rewrite goes beyond triage's "Undetermined" fix and that the download check was unasked; both were rejected on adjudication (triage names no fix to contradict; the old title already claimed all 20 relays). Code probes (stalled downloads, early sending=false, slow /small target) each make the test fail.

Written by an agent.

…s windows close (#688)

Fixed 64 MiB bodies ended before the probes' windows on fast hardware,
and the window before an answer began before the relays moved on a
loaded one. Bodies now run until a second after the last answer, the
probes start a second after all 20 relays moved, and downloads are
checked as the title always claimed.

Co-Authored-By: Claude <noreply@anthropic.com>
@V3RON

V3RON commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Review ledger

Round 1: f21dc76

Runs: 4. Cost USD: 0.6562. Agent seconds: 267.
Tokens input 36, output 12354, cache read 342445, cache write 98461.

  • review 1 code both: claude-opus-5-5 221 s $0.391
  • review 1 spec: claude-sonnet-5-5 15 s $0.0712
  • review 1 claims: claude-sonnet-5-5 16 s $0.0807
  • review 1 reviewer: claude-opus-5-5 15 s $0.1133
    Finding outcomes: {"duplicate":1,"incorrect":1,"nonblocking":1}. Classes: {"assumption decides contract":1,"behaviour not asked (downloads checked)":1,"fix not asked / contradicts rejected alternative":1}.
{"findings":[
{"id":"R1","role":"spec","class":"fix not asked / contradicts rejected alternative","outcome":"nonblocking","path":"src/daemon/relay-promises.timing.test.ts:154","round":"1"},
{"id":"R2","role":"spec","class":"behaviour not asked (downloads checked)","outcome":"incorrect","path":"src/daemon/relay-promises.timing.test.ts:261","round":"1","canonicalId":null},
{"id":"R3","role":"spec","class":"assumption decides contract","outcome":"duplicate","path":"assumptions.md:1","round":"1","canonicalId":"R1"}]}

@V3RON
V3RON marked this pull request as ready for review October 23, 2026 10:18
@V3RON
V3RON merged commit 05cc840 into main Oct 23, 2026
69 of 71 checks passed
@V3RON
V3RON deleted the bug/688 branch October 23, 2026 10:20
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.

flaky: relay-promises timing test fails with 'u0 finished early' on CI

1 participant