What problem does it solve?
Testing resumable state machines in Turso (commits, checkpoints, cursors) against rare interleavings and abandonment scenarios is hard to reproduce; this Skill explains how to use the yield and failure injection machinery to force cooperative-yield boundaries deterministically in tests.
Core Features & Use Cases
- Yield and Failure Injection: Use
inject_transition_yield!, inject_io_yield!, and inject_transition_failure! macros with YieldPointMarker enums to force StepResult::Yield or LimboError at exact state-machine boundaries.
- Fixed Test Injectors: Configure
FixedYieldInjector and FixedFailureInjector on a connection to target specific points like commit LogRecordPrepared or checkpoint BeforeAcquireLock in unit tests.
- Deterministic Simulator Plans: Understand how the concurrent simulator plans yields keyed by
(instance_id, selection_key, point_count) so seeds remain reproducible.
- Use Case: When adding a new yield point to the commit state machine, follow the checklist to append the enum variant without reordering, place the macro after the resumable state transition, and add an abandoned-statement test verifying cleanup invariants.
Quick Start
Ask the assistant to add a new yield point to the commit state machine with a deterministic fixed-injector regression test following the yield injection guide.