starspec
Parallel RSpec runner for I/O-bound Rails suites. Runs specs concurrently across threaded Actors, each with its own ActiveRecord Connection, relying on PostgreSQL's native MVCC for test isolation. No forking, no per-worker Rails boot, no per-worker test database.
Status: pre-alpha. Design and validation planning complete; implementation in progress.
How it differs
- One process, N Actors. Actors are Ruby threads, each running examples in a transaction that rolls back at the end. PG handles cross-Actor isolation natively.
- SystemTests supported in parallel. A cookie-based
ActorContexttransport lets the PumaRequestThread handling a Capybara request borrow the originating Actor's Connection, so the test sees its own uncommitted writes across the thread boundary. The mechanism generalizes to other transports (Sidekiq, ActiveJob, ActionCable) via pluggable adapters. - Small, targeted monkey-patch. ~10 lines prepending a module onto
ActiveRecord::ConnectionAdapters::ConnectionPool. Nopin_connection!, no fight withteardown_fixtures.
Docs
docs/DESIGN.md— authoritative design (Actor pattern, ConnectionBorrowing, ActorContext, cookie transport, scope boundaries).docs/GLOSSARY.md— precise terminology (TestProcess, Actor, Connection, PumaRequestThread, etc.).docs/investigation/— notes from the spike investigation that produced the current design.
Installation
bundle add starspec
or
gem install starspec
Usage
TODO.
Development
bin/setup # install dependencies
bundle exec rspec # run the gem's own specs
rake build # build .gem into pkg/
License
MIT. See LICENSE.txt.