Skip to content

State predicates asserted in only one polarity (mutation survivors) #569

Description

@leynos

Context

From the first full mutation-testing run (ADR-007 workflow, 2026-07-04, partial). A cluster of state predicates is only ever asserted in one polarity, so forcing them to a constant survives the suite.

Surviving mutants

  • src/connection/state.rs:70replace ActorState::is_shutting_down -> bool with false (the true mutant times out; the false mutant survives). Used in production at src/connection/mod.rs:314-315 to gate availability snapshot flags, yet tests/connection.rs only asserts !is_shutting_down or branches on it — never asserts it is true during shutdown.
  • src/client/response_stream.rs:104replace is_terminated -> bool with true. src/client/tests/streaming.rs asserts is_terminated() == true after the terminator only; nothing asserts !is_terminated() mid-stream.
  • src/app/envelope.rs:129replace Packet::is_stream_terminator -> bool with true (default method). The real impl Packet for Envelope does not override it, so the default false is production behaviour, but all terminator tests use types that override the method.
  • src/connection/multi_packet.rs:82replace MultiPacketContext::is_stamping_enabled -> bool with true. With stamping disabled the mutant clobbers a pre-set correlation id via set_correlation_id(None) instead of leaving the frame untouched; tests/correlation_id.rs only covers enabled stamping.

Suggested tests

  1. Drive a shutdown and assert snapshot.is_shutting_down == true within the shutting-down window.
  2. After a data frame but before the terminator, assert !stream.is_terminated().
  3. Assert a plain Envelope reports is_stream_terminator() == false.
  4. Send a multi-packet frame carrying a pre-existing correlation id with stamping disabled and assert the id is preserved.

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