Skip to content

id(world_records tests): Node harness races author creation — 'author not found' at write_raw under default parallelism (serial runs green) #6681

Closed

Description

@dezren39

Problem

The world_records test module's Node harness intermittently fails under default cargo test parallelism: tests panic at write_raw's set_bytes unwrap with iroh-docs "author not found" — before any code under test runs. Serial runs are green.

Evidence (2026-11-07, laptop, queue worker lane code-a)

Suspected race: RecordsStore::open creates/looks up the author in the docs engine and set_bytes can run before the author is visible to the store under parallel load (multiple Node::spawn instances in one test binary).

Why it matters

Half the receipt-path safety-net tests flapping red under the default invocation trains everyone to ignore failures in exactly the module that guards replicated record caps — and forces serial runs for verification (this cost real time on issue #6634).

Acceptance criteria

  • Root cause identified (author creation/visibility race in the harness or in RecordsStore::open) and fixed at the right layer — harness waits for author readiness, or open awaits it.
  • cargo test -p id --lib world_records (default parallelism) passes repeatedly (e.g. 5 consecutive runs) on the laptop.
  • No test coverage removed or marked ignored to get there.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    priority/normalOrdinary priority (the default)
    on Nov 7, 2026
  2. developing-today commented on Nov 7, 2026

    @developing-today
    Contributor
  3. added
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Nov 7, 2026
  4. dezren39 commented on Nov 7, 2026

    @dezren39
    MemberAuthor

    Picked up by repo-worker-code-r (lane R, fallback mode — queue backend down, PostgREST 503 at gate) for triage: verify the world_records Node harness author race against fresh main, identify root-cause layer, and route (fix-task follow-up or confirmed triage).

  5. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed on Nov 7, 2026
  6. dezren39 commented on Nov 7, 2026

    @dezren39
    MemberAuthor

    Progress from repo-worker-code-r: verified-on-main: RecordsStore::open (pkgs/id/src/world_records.rs:87) takes docs.author_default() then docs.create(); the test Node harness (same file, tests mod) spawns a full in-memory Docs per test via Docs::memory().spawn(...). Next: reproduce on laptop clean-main worktree — default parallelism vs serial control.

  7. dezren39 commented on Nov 7, 2026

    @dezren39
    MemberAuthor

    Progress from repo-worker-code-r: reproduced-setup: clean-main worktree ~/git/fleet/fb-6681 at origin/main 2b426f7 (includes PR #6678 / #6634 merge). cargo test for world_records compiling on laptop now (note: -p id does not resolve at workspace root; running from pkgs/id). Next: default-parallelism result vs serial control.

  8. dezren39 commented on Nov 7, 2026

    @dezren39
    MemberAuthor

    Triage complete — not reproducible on current main (20 consecutive green parallel runs, incl. stress). Closing as no-longer-reproducible; reopen with the capture list below if it recurs.

    Worked by repo-worker-code-r (lane R) in fallback mode (queue backend down). Fresh verification against origin/main 2b426f7d06 (includes PR #6678, the #6634 merge), clean worktree ~/git/fleet/fb-6681 on the laptop:

    Run Conditions Result
    1 fresh compile + cargo test --lib world_records (default parallelism) 15 passed / 0 failed
    2–7 6× repeat, default parallelism 15/15 each
    8–19 12× stress: 4 test binaries concurrently × 3 rounds (each binary itself threaded) 15/15 each, zero author not found
    20 recompile + 8 CPU hogs saturating the box during the run 15/15

    Code verified on main: RecordsStore::open (pkgs/id/src/world_records.rs:87) takes docs.author_default() before docs.create(); the test Node harness spawns a fully in-memory Docs::memory() per test, so there is no cross-test shared author store on current main — the suspected visibility race has no shared surface left to act on in the harness as written.

    Why this doesn't contradict the original report: lane code-a reproduced 6/12 failing twice (patched + clean-main control at 24b0b64b90) — that rate is incompatible with 20/20 green here under heavier parallelism, so conditions changed materially between that main and 2b426f7d06 (the #6634 receipt-path work itself landed in between via PR #6678). The flake's trigger is gone or drastically rarer on current main; there is no identified defect left to fix.

    If it recurs, reopen with: the main SHA, the full panic output, whether the run followed a fresh compile in the same cargo test invocation, and concurrent build load on the machine. That data is what a root-cause fix needs; without a repro, a speculative "wait for author readiness" patch would be untestable churn in the receipt-path safety net.

  9. dezren39 commented on Nov 7, 2026

    @dezren39
    MemberAuthor

    Released by repo-worker-code-r (outcome: done). Triage complete: NOT REPRODUCED on current main 2b426f7 — 20 consecutive green default-parallelism runs of cargo test --lib world_records (15/15 each) including 12-way concurrent-binary stress and a CPU-saturated recompile run, zero 'author not found'. Issue #6681 closed as no-longer-reproducible with the full evidence table and a reopen capture list in the triage findings comment. No PR (no defect identified to fix).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/idPackage/app: id (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)status:donetask/triageQueue packet kind: verify, reproduce, and route this item

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions