Skip to content

node: cover the window pull-through 'served-but-not-cached' path (node_pull_through_tee_finalize_failed) #896

Closed

Description

@thiras

Follow-up from the #893 review (implements #856). Test-coverage gap.

Gap

crates/node/src/handlers/client.rs finalize meters node_pull_through_tee_finalize_failed for the case where bytes were served and paid but tee.finish() failed to promote the blob (warm-cache benefit forfeited, delivery still succeeded). This alertable "served but not cached" condition currently has zero test coverage — distinct from upstream_verify_failed, which is covered.

Note the #893 review also split this path: a tee HashMismatch (forwarded vs teed streams diverge) now logs at error while a store fault logs at warn. A test that forces a store-side promote failure on an otherwise-good delivery would pin both the metric and the served-anyway behavior.

Why deferred

Needs a store-side promote failure injected on an otherwise-successful delivery, which is non-trivial to trigger deterministically in the current harness.

Filed from the #893 multi-agent review.

Activity

  1. added
    rust
    kind:test
    prio:low
    on Jun 13, 2026
  2. added a commit that references this issue on Jun 13, 2026
  3. github-actions commented on Jun 13, 2026

    @github-actions

    🎯 Triage report

    A test-coverage gap filed from the #893 multi-agent review, as a follow-up to the #856 implementation. The node_pull_through_tee_finalize_failed metric path in crates/node/src/handlers/client.rs — covering the "bytes served and paid, but blob not promoted to cache" scenario — has zero coverage. The issue also calls out the #893-introduced log-level split (HashMismatch → error, store fault → warn) as a second invariant to pin.

    📊 Assessment

    Dimension Value Reasoning
    Type Task Test-coverage gap, not a defect in shipped behavior
    Labels rust, testing, low (unchanged) Already applied correctly; low is appropriate since delivery still succeeds on this path
    Coding agent Needs more info Scope is clear, but the harness challenge (injecting a store-side finish() failure on an otherwise-successful delivery) may need a mock/trait shim that doesn't exist yet — agent would need to verify what testability seams are available

    🔗 Similar issues

    💡 Notes and suggestions

    Two sub-cases to cover (from the #893 split):

    1. HashMismatch — forwarded and teed byte streams diverge → should log at error, metric fires.
    2. Store fault — tee.finish() returns an Err (promote fails, e.g., I/O or internal store error) → should log at warn, metric fires, delivery still returns success to client.

    Approach to unblock:

    • Check crates/cache/ for any existing finish() / promote test helpers or mock BlobStore traits. If a MockBlobStore or FakeStore exists, it may already support failure injection.
    • If not, the minimal lift is to introduce a thin TeeFinisher trait (or use a closure/Box<dyn FnOnce>), allow tests to swap in a failing impl without touching production paths.
    • Alternatively, if iroh-blobs exposes in-memory store implementations (likely under #[cfg(test)]), a pre-sabotaged store could be constructed directly.

    Checklist:

    • Audit existing client.rs test harness for store injection points
    • Add test: store-fault path → node_pull_through_tee_finalize_failed incremented, no error returned to client, log at warn
    • Add test: HashMismatch path → metric fires, log at error
    • Confirm upstream_verify_failed test is not accidentally covering either new case (false green)

    Generated by Agentic Triage for issue #896 · ◷

    Add this agentic workflows to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/issue-triage.md@94ec5db57374c5b04a4b8eef8b4413f9af44d63f
    
  4. self-assigned this
    on Jun 17, 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:lowrust

Type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions