Skip to content

Mutation testing: connection actor snapshot and output survivors #597

Description

@leynos

Context

From the first complete full mutation-testing run (ADR-007 shared workflow, run 29074771985, 2026-07-10, main @ 94a5d44). These survivors are from the shard that was lost in the July partial runs, so they are newly visible rather than newly introduced.

Surviving mutants

  • src/connection/output.rs:65replace ActiveOutput::clear_response with ()
  • src/connection/state.rs:78replace ActorState::closed_sources -> usize with 0 / 1
  • src/connection/state.rs:82replace ActorState::total_sources -> usize with 0 / 1
  • src/connection/counter.rs:32replace current_count -> u64 with 0 / 1

Analysis

Every existing run-loop test ends the response stream as the last live source, so whether the exhausted stream is cleared or re-polled is indistinguishable. The cfg(test) snapshot accessors closed_sources/total_sources feed ActorStateSnapshot, but actor_state_tracks_sources (tests/connection.rs) asserts only the boolean flags, never the counters. current_count is a pub(super) duplicate of the tested active_connection_count, consumed only by an info! log line.

Suggested tests

  1. Run an actor whose response stream ends (or fails with WireframeError::Protocol) while a push queue remains open; assert on_command_end fires exactly once and no duplicate stream-end frame is emitted (kills clear_response).
  2. Extend actor_state_tracks_sources to assert snapshot.total_sources equals the constructed source count and that closed_sources increments by one per mark_closed() (kills all four accessor mutants).

Accepted

connection/counter.rs:32 feeds a log line from a process-global atomic; asserting it under parallel tests would be nondeterministic. Accepted — though deleting the wrapper in favour of active_connection_count() would remove the mutants entirely.

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