testo / fiber
Fiber/coroutine execution plugin for the Testo testing framework: run tests as cooperatively-scheduled plain fibers.
Fund package maintenance!
Requires
- php: >=8.2
- testo/testo: 0.10.39 - 1
README
Fiber / coroutine plugin
Important
🪞 This is a read-only mirror.
Active development of the Testo project lives in php-testo/testo under plugin/fiber/. This repository is automatically synchronized from there on every release.
File issues and pull requests in the main monorepo, not here.
About
Runs tests as plain PHP fibers driven by Testo's own cooperative scheduler, so a test (or the code it exercises) may suspend with \Fiber::suspend() and be resumed, and a case's tests may be interleaved to shake out order-dependent races.
#[RunInFiber]— run a test (method) or a whole case (class) inside fibers, scheduled bySchedule::Solo(default),RoundRobinorRandom.
Switching is cooperative and happens only at suspension points — there is no event loop and no preemption. This is for fiber-based/cooperative code and race hunting, not for real async I/O: awaiting a timer, socket or Future needs the Revolt event loop — use the testo/bridge-revolt #[RunInRevolt] attribute for that.
The attribute lives under the Testo\Fiber\ namespace.
Install
composer require --dev testo/fiber