Parallel testing with Ractors - Putting CPU's to work
summary
Builds a mini test framework called Loop that runs examples via Ruby 3 Ractors and via traditional process mode and measures wall time: Ractors beat processes on small suites because forking costs dominate, but converge on realistic suites. Reports concrete limitations — class variables and runtime-defined methods aren’t visible across Ractors, metaprogramming must be constrained, and application code must be Ractor-compatible. Finds real Ruby bugs (segfaults and a deadlock), fixes one, and shows the reactor approach works but remains experimental.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 1:13What are tests
- 4:48How Rails works
- 6:07How Ractors work
- 10:55Keeping track of test classes
- 17:17Building an executable
- 18:10Parallelizing tests
- 19:25Multiple reporters
- 25:12Bugs
related talks
28mCome Discuss Ractors and Concurrency with 'The Dude'!
25mRactor Demonstration
28mRactors in Ruby 4.0: Message Passing Without the Pain
30mRactor on Ruby 3.4
29mMillion-Agent Ruby: Ractor-Local GC in the Age of AI
26mConcurrency in Ruby: From fork() to Fiber
28mConcurrency for Rubyists
31mPortable and Fast - How to implement a parallel test runner
