Skip to content

[major] Failed testrun member with --retry overwrites the last-good recording with a corrupt one (recording_invalid: non_monotonic_steps) #148

Description

@tlemmonds

Summary

When a testrun run --retry member fails, the retry/shrinking-replay cycle replaces the last-good recording on disk with a mangled one (artifacts.replaced: true on a failed run). Every subsequent standalone replay of that test then hard-fails in ~3s before any browser work:

{"type":"error","message":"recording_invalid: non_monotonic_steps: expected 8, got 1 at line 8"}

The evidence pack for that follow-up run also fails L1 validation (l1.steps.missing: L1 requires a steps/ directory).

Repro (kane-cli 0.6.4, 2026-07-22)

  1. A multi-step test with a valid recording (just authored green the same hour).
  2. kane-cli testrun run <paths...> --retry --headless — the member fails on an unrelated replay assertion (see companion issue on stale replay variables) after ~112s of retry cycles.
  3. kane-cli testmd run <same test>recording_invalid: non_monotonic_steps in 3s; recording unusable.
  4. Recovery required a prose edit to force a full re-author (in place, same testcase_id).

Control: the same suite re-run without --retry also failed the same members but did not corrupt recordings (artifacts.replaced: false) — the clobbering isolates to the retry path.

Ask

A failed run should never replace last-good artifacts: write retry attempts to a scratch location and promote only on success (or at minimum keep a .bak of the previous recording and restore it when the run ends failed).

Env: kane-cli 0.6.4 · Windows 11 · Node 24 · account toddl

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions