Skip to content

flaky: loser-release seller test spends its 5s claim budget on NIP-42 relay auth #780

Description

@orveth

Symptom

seller_node::run::tests::a_losing_open_pool_claimant_releases_its_slot_when_it_sees_the_award
fails intermittently in the Money-path tests job:

thread '...a_losing_open_pool_claimant_releases_its_slot_when_it_sees_the_award' panicked at
crates/maxplayer-core/src/seller_node/run.rs:8311:17:
the loser must claim the open-pool offer
test result: FAILED. 967 passed; 1 failed; 1 ignored

The assertion is a wall-clock-bounded poll:

pump_offers_until(&loser, &mut loser_notifs,
    std::time::Instant::now() + Duration::from_secs(5),
    |r| r.node.store().claim_row_state(&job_id).ok().flatten().is_some())

Mechanism (primary)

The 5s budget is spent on relay NIP-42 auth latency, not on the behaviour under test. Both
seller nodes in the failing run logged a 20-second auth stall, twice, immediately before the
panic — inside the failing test's own captured output:

23:28:45Z seller node WARN: no NIP-42 challenge within 20s; proceeding (auto-auth stays ON ...)
23:29:05Z seller node WARN: no NIP-42 challenge within 20s; proceeding ...

Two 20s stalls against a 5s claim budget. The winner reserved its slot; the loser had no budget
left to claim within the deadline. The test asserts a liveness property ("the loser also
claims") but bounds it with a latency deadline that includes relay auth, so it measures the
relay's auth responsiveness as much as the claim logic.

Evidence that it is non-deterministic, not a code defect

Two CI runs on fix/774-delivery-store-compaction, consecutive, ~21 minutes apart:

a128e8ca (23:02Z) c679dbf3 (23:23Z)
Money-path success (run 31752342167) failure (run 31753646179)
result 968 passed; 0 failed; 1 ignored 967 passed; 1 failed; 1 ignored
duration 214.07s 218.46s
no NIP-42 challenge within 20s 0 2

The full a128e8ca..c679dbf3 diff is 16 lines, all inside a single /// doc block, zero
executable change
. Identical executable semantics produced opposite outcomes, and the relay-auth
stall is present only in the failing run.

Open question — suite-load hypothesis

#779 adds fd-pressure legs that drive 80 deliveries each. An open question is whether that added
suite load raises this test's flake probability relative to base main.

Weighing the evidence honestly: the pass/fail pair above does not settle this either way. Both
shas carry #779's full added load, so load was constant across the pair — which isolates
non-determinism at that load level, but is neutral on whether that load level flakes more often
than main's. A rate hypothesis needs a rate measurement (many runs at each load), not two samples
at the same load. Recorded here as an open question, not a blocker.

Suggested directions (not prescriptions)

  1. Exclude relay auth from the budget — await NIP-42 completion (or disable auth in the fixture)
    before starting the claim deadline.
  2. Raise the bound. This is a liveness assertion; a 5s wall-clock cap encodes a latency SLO nobody
    intended.
  3. Drive the wait off the awaited event rather than a wall-clock poll.

Artifacts

Test introduced in dc9e034 (#530). Filed from the #779 review; #779 does not touch
seller_node/run.rs.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions