Skip to content

Point parallel_rspec at the cached spec runtime log - #33

Merged
gavinomelia merged 2 commits into
mainfrom
fix-parallel-rspec-runtime-log
Aug 31, 2026
Merged

Point parallel_rspec at the cached spec runtime log#33
gavinomelia merged 2 commits into
mainfrom
fix-parallel-rspec-runtime-log

Conversation

@gavinomelia

@gavinomelia gavinomelia commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

parallel_rspec reads tmp/parallel_runtime_rspec.log by default, but rails-ci.yml and both composite actions restore the cached runtime log to tmp/turbo_rspec_runtime.log — the path rolemodel_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

  • Pass --runtime-log so parallel_rspec actually reads the cached runtimes
  • Apply the same fix to both legacy composite actions
  • Rename the two cache steps, labelled "Turbo-Test" but feeding parallel_rspec
  • Add a CHANGELOG entry for v3.11.3

Measured on CI

Verified end to end on ServeWell (blacksmith-16vcpu, 16 processes) by pinning its ci.yml at this branch. Baseline is the five most recent successful main/feature runs; the fix is run 33420158397.

baseline (5 runs) with fix
rspec step 353s mean (336–371) 267s −86s, −24%
slowest worker 349s mean 264s −85s
worker spread ~208s 46s −78%
idle core-seconds 29% 8%
total work 3959s 3902s unchanged

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

@gavinomelia gavinomelia self-assigned this Aug 31, 2026
@gavinomelia gavinomelia changed the title Point parallel_rspec at the cached spec runtime log #patch Point parallel_rspec at the cached spec runtime log Aug 31, 2026
gavinomelia and others added 2 commits August 31, 2026 13:48
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
gavinomelia force-pushed the fix-parallel-rspec-runtime-log branch from 153537e to 4658521 Compare August 31, 2026 17:48
@gavinomelia
gavinomelia merged commit bd3db8d into main Aug 31, 2026
@gavinomelia
gavinomelia deleted the fix-parallel-rspec-runtime-log branch August 31, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants