Skip to content

SessionRegistry::prune retention of live handles is untested (mutation survivor) #566

Description

@leynos

Context

From the first full mutation-testing run (ADR-007 workflow, 2026-07-04, partial). Survivor: src/session.rs:180replace > with == in SessionRegistry<F>::prune (also replace prune with ()).

Analysis

prune_removes_dead_entries (tests/session_registry.rs) asserts registry.get(id).is_none() after prune() — but get itself removes dead entries opportunistically, so the test passes even when prune does nothing. More importantly, no test asserts that a live handle survives pruning: mutating strong_count() > 0 to strong_count() == 0 would evict every live session and no test would notice.

The related get mutant (src/session.rs:101, == with !=) was assessed as equivalent/low value: get returns None for dead handles regardless; only opportunistic cleanup is affected, and active_ids/active_handles self-heal.

Suggested test

Insert a live handle and a dead one, call prune(), then assert the live handle is still retrievable (get(live_id).is_some() and present in active_ids) while the dead one is gone — without routing the dead-entry assertion through self-healing get alone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlowAin't annoying anyone but the QA departmentmediumCould be disruptive, but might not happentesting

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions