Skip to content

test(node): same once-read metrics race in two more client_loopback tests #2713

Closed

Description

@yigitdot

Follow-up to #2682. The same race deflaked there — the test encodes metrics as soon as the client reads the server's reply, but ServeEnd::meter bumps the reject/reset counters only when the spawned serve task ends, after the response is on the wire (crates/node/src/handlers/client/dispatch.rs → outcome.rs) — also exists in:

  • the_timestamp_gate_precedes_every_signed_refusal (crates/node/tests/client_loopback.rs): reads metrics.encode() once after each refusal and asserts the rejected-total lines.
  • stream_request_with_skewed_timestamp_resets_without_response (same file): reads the encoded metrics once right after observing the stream reset.

On a loaded runner the client can win that race and see a counter one short. Fix as in #2682: replace the once-read encode + ensure! with the bounded support::wait_for_metric_line poll (10 s deadline, 20 ms sleeps) for the final counter assertion in each test. Test-only; no production code changes.

Activity

  1. added a commit that references this issue on Oct 28, 2026
    ae426bd
  2. yigitdot commented on Oct 28, 2026

    @yigitdot
    ContributorAuthor

    Folded into #2716 rather than a separate PR; it closes this issue on merge.

  3. moved this from Backlog to In progress in deCDNon Oct 28, 2026
  4. moved this from In progress to Done in deCDNon Oct 28, 2026
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

    Fields

    Priority

    None yet

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions