yield-injections
yield-injections provides test-only infrastructure for injecting cooperative yields and synthetic failures into resumable state machines. Use it to test state-machine re-entry safety, interleaving behavior, and abandonment cleanup by marking yield points and controlling when they fire. Includes fixed injectors for unit tests and simulator support for randomized deterministic coverage.
yield-injections enables testing of resumable state machines by injecting controlled yield and failure boundaries at specific points.
AI-generated summary based on this skill's SKILL.md
Install
tursodatabase/turso/yield-injections · repository language: Rust
git clone https://github.com/tursodatabase/turso
cp -r turso/.claude/skills/yield-injections ~/.claude/skills/yield-injectionsFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
What is yield-injections and what does it test?
yield-injections provides test-only infrastructure for injecting cooperative yields and synthetic failures into resumable state machines. It lets you mark yield points, control when they fire, and verify state-machine re-entry safety, interleaving behavior, and abandonment cleanup. The skill includes fixed injectors for unit tests and simulator support for randomized deterministic coverage.
How do resumable state machine boundaries stay safe and re-entrant?
yield-injections ensures resumable state machine boundaries are safe and re-entrant by providing controlled yield and failure injection points. You can test that state machines correctly handle mid-yield drops, verify cleanup behavior when statements abandon, and confirm that re-entry after a yield doesn't corrupt state or violate invariants.
Can yield-injections run deterministic interleaving tests?
Yes. yield-injections supports deterministic concurrent interleaving tests with reproducible seeds. This lets you simulate lock contention and out-of-order completion scenarios in a controlled, repeatable way, ensuring your concurrent code behaves correctly across different execution orders.
What happens when statements drop mid-yield in yield-injections?
yield-injections verifies cleanup and abandonment behavior when statements drop mid-yield. It lets you inject failure points at yield checkpoints to test that resources are properly released, state is rolled back correctly, and no dangling references or leaked cursors remain after an abandoned statement.
Does yield-injections support synthetic failure injection?
Yes. yield-injections includes YieldInjector and FailureInjector components for synthetic failure injection into state machines. You can inject transition yields using macros, mark checkpoint yield points, and control cursor yield injection to test how your code handles failures at specific interleaving moments.
What license does yield-injections use?
yield-injections is released under the MIT license, allowing free use, modification, and distribution in both open-source and commercial projects with minimal restrictions.
SKILL.md
rendered from the published skill — quoted content, verbatim
Yield Injection Guide
Yield injection is test-only infrastructure for forcing cooperative-yield or failure boundaries in resumable state machines. The implementation currently lives under core/mvcc/, but the mechanism is not MVCC semantics.
Key Files
core/mvcc/yield_points.rs: injector traits and macros.core/mvcc/yield_hooks.rs:YieldPointMarker,YieldContext,ProvidesYieldContext.core/connection.rs: per-connection injector slots andyield_instance_id_counter.core/mvcc/database/mod.rs: commit points and commit cleanup.core/mvcc/database/checkpoint_state_machine.rs: checkpoint points.core/mvcc/cursor.rs: cursor points.core/mvcc/database/tests.rs: fixed test injectors
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 1 file
.claude/skills/yield-injections/SKILL.md