Skip to content

test(e2e): pin the authorized-origin refusal to the gate via metrics #1371

Closed

Description

@yigitdot

Follow-up from the review of #1366.

G-NODE-08 asserts the gated refusal arrives as wire StreamError::NotFound. That is necessary but not sufficient: ServeRejectReason::wire_error (crates/node/src/handlers/client/mod.rs:530) collapses seven reasons onto NotFound — CacheMiss, UnknownChannel, OwnerMismatch, InsufficientDeposit, UnauthorizedOrigin, CooperativeCloseSigned, RangeNotSatisfiable. The source comment there says so outright: "the wire NotFound it produces is indistinguishable from a plain miss, so an end-to-end test cannot observe it."

Today the journey discriminates structurally — same node/config, only chain state changes, and the positive half succeeds — plus a cached-blob control that rules out a dead channel. That reasoning is sound but circumstantial.

There is a direct signal available: decdn_serve_stream_rejected_unauthorized_origin_total (crates/node/src/metrics.rs:3206), incremented at wire.rs:118 before the network write.

Proposal: NodeFixture already allocates a metrics_port (crates/e2e/src/node.rs:298) but discards it. Store it, add a scrape_metric(name) -> u64 helper, and assert the counter goes 0 → 1 across the refused fetch. That converts the headline assertion from circumstantial to direct, and would let the assertion message drop its current hedging.

Useful beyond G-NODE-08 — any journey asserting a specific reject reason has the same problem.

Activity

  1. added
    kind:test
    rust
    prio:medium
    on Jul 22, 2026
  2. self-assigned this
    on Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind:testprio:mediumrust

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions