Skip to content

[starter] Expand deterministic cancellation race regression coverage #4

Description

@ashishki

Problem

Cancellation is implemented for queued and running jobs, but terminal-state correctness benefits from an explicit table-driven interleaving matrix.

Bounded scope

Add deterministic tests for cancel-before-lease, cancel-during-run, completion-versus-cancel, timeout-versus-cancel, and repeated cancel requests using local PostgreSQL/Redis fixtures.

Acceptance criteria

  • Each interleaving has an explicit expected terminal state and event sequence.
  • Every case proves at most one terminal lifecycle event and zero duplicate-terminal invariant violations.
  • Repeated cancel requests are idempotent or have a documented deterministic rejection.
  • Tests avoid timing sleeps where controllable synchronization can be used.
  • Existing behavior changes only if a failing regression test demonstrates an invariant defect.

Non-goals

No distributed consensus, exactly-once claim, new scheduler, or production load benchmark.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions