Point parallel_rspec at the cached spec runtime log - #33
Merged
Conversation
wesrich
approved these changes
Aug 31, 2026
Jeremy-Walton
approved these changes
Aug 31, 2026
parallel_rspec reads tmp/parallel_runtime_rspec.log by default, but rails-ci.yml and both composite actions restore a cached log at tmp/turbo_rspec_runtime.log — the path rolemodel_rails' generator writes into .rspec_parallel. parallel_rspec found no runtimes and silently fell back to grouping specs by file size. On a 16-process ServeWell run the processes finished between 2m47s and 5m58s, leaving ~1,770 core-seconds (31% of the runner) idle. Replaying the grouping against recorded runtimes drops the critical path from 386s to 203s. Adds a runtime_log input so apps that write the log elsewhere can redirect the cache, the flag, and the analyzer together. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
gavinomelia
force-pushed
the
fix-parallel-rspec-runtime-log
branch
from
August 31, 2026 17:48
153537e to
4658521
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
parallel_rspecreadstmp/parallel_runtime_rspec.logby default, butrails-ci.ymland both composite actions restore the cached runtime log totmp/turbo_rspec_runtime.log— the pathrolemodel_rails' generator writes into every app's.rspec_parallel. It therefore never found the runtimes and silently fell back to grouping specs by file size, so worker processes finish minutes apart while cores sit idle.Changes
--runtime-logsoparallel_rspecactually reads the cached runtimesparallel_rspecMeasured on CI
Verified end to end on ServeWell (
blacksmith-16vcpu, 16 processes) by pinning itsci.ymlat this branch. Baseline is the five most recent successfulmain/feature runs; the fix is run 33420158397.Total work is flat, so this is redistribution rather than the suite getting cheaper. The fixed run prints
Using recorded test runtime; none of the five baseline runs do.The residual 8% is a floor from indivisible files — ServeWell has a single 191s example (
spec/jobs/generate_packet_job_spec.rb) so no worker can finish before ~218s.Notes
parallel_testsrescues the missing file and falls back to file size, exactly as today..rspec_parallelwrite totmp/turbo_rspec_runtime.log, so the path is safe to hardcode.mainand still pinsactions/cache@v5.)