Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Parallelizing tests is an opportune way of reducing the total runtime for a test suite. Rails achieves this by forking multiple separate workers that fetch tests from a queue. In Ruby 3, Ractors introduced new mechanisms for executing code in parallel. Can they be leveraged by a test framework? And how would that compare to current parallelization solutions? Let’s find the answers to these questions by building a test framework built on Ractors, from scratch. We’ll compare the current solutions for parallelization and what advantages or limitations Ractors bring when used in this context. RubyKaigi Takeout 2021: https://rubykaigi.org/2021-takeout/presentations/vinistock.html
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
This video presented by Vinicius Stock at RubyKaigi Takeout 2021 focuses on the topic of parallel testing using Ractors in Ruby, aiming to optimize test suite runtimes by leveraging Ruby's parallel execution capabilities introduced in Ruby 3. The talk explores whether building a parallel test framework using Ractors offers advantages over current implementations. Key points discussed include: - **Introduction to Ractors**: Stock introduces Ractors as a new feature in Ruby that supports parallel execution and outlines how they can communicate. - **Test Execution Strategies**: Two primary strategies for executing tests in parallel are detailed: 1. **Group Division**: Dividing tests into groups assigned to different CPUs may lead to uneven execution times, with some CPUs finishing early due to differences in test complexity. 2. **Queue Mechanism**: A more efficient approach using a queue to allow CPUs to pull tests as they are ready, implementing a mini-test plugin for Rails. - **Building a Test Framework**: Stock walks through the construction of a framework using Ractors, similar to MiniTest, focusing on areas such as execution, utilities, and reporting. - **Implementation of Ractor Pool**: An explanation of creating a worker pool using Ractors to parallelize the execution of tests, including the management of messages and processing results concurrently. - **Limitations of Using Ractors**: Important challenges include the restrictions on class variables and the necessity for the tested code to be Ractor-compatible. - **Performance Comparisons**: Demonstrations of the framework highlight the differences in performance between traditional process forking and Ractor execution, noting some advantages, particularly for large test suites. - **Interactive Reporter Feature**: The speaker discusses the interactive mode of the framework that allows for easier navigation through test results, especially when failures occur. In conclusion, while Ractors present a promising avenue for parallel testing in Ruby, developers must navigate certain limitations inherent in their design. The framework developed, called 'Loop', is available on GitHub and offers insights into optimizing test execution using Ractors. The video emphasizes the potential evolution of Ruby parallelism through continued experimentation and development.
Suggest modifications
Cancel