Skip to content

RewindStream::poll_read replay path lacks byte-delivery assertions (mutation survivors) #565

Description

@leynos

Context

From the first full mutation-testing run (ADR-007 workflow, 2026-07-04, partial). Survivors in <impl AsyncRead for RewindStream<S>>::poll_read in src/rewind_stream.rs.

Surviving mutants

  • src/rewind_stream.rs:72< with == / < with > / < with <=, > with ==, || with &&
  • src/rewind_stream.rs:77>= with <, && with ||, delete !

Analysis

The only direct unit test covers the invalid-leftover-bounds error path. The replay-then-inner path is exercised indirectly (client/server leftover handling), almost always with empty leftover, which skips both mutated branches. No test asserts correct byte delivery when the read buffer is smaller than the buffered leftover (to_copy < remaining).

Suggested test

Unit-test RewindStream with non-empty leftover and a ReadBuf smaller than the leftover: poll repeatedly and assert the exact bytes and ordering across the split, followed by bytes from the inner stream.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestmediumCould be disruptive, but might not happentesting

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions