0.0
The project is in a healthy, maintained state
πŸ—‚οΈ RuntimeGroups extracts the small parallel-runner primitives from turbo_tests2 β€” worker process count resolution, pid-file bookkeeping, runtime log recording, and runtime-weighted balanced file grouping β€” into a dependency-free gem that is engine-portable across MRI, JRuby, and TruffleRuby.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 0.1, >= 0.1.5
~> 3.2, >= 3.2.6
~> 2.0, >= 2.0.16
~> 3.1, >= 3.1.28
~> 2.0, >= 2.0.29
~> 13.0
~> 1.0, >= 1.0.4
~> 1.0, >= 1.0.10
~> 4.0, >= 4.0.1

Runtime

~> 1.1, >= 1.1.17
 Project Readme

galtzo-floss Logo by GitHub

πŸ—‚οΈ RuntimeGroups

Version Ruby Users Forum GitHub tag (latest SemVer) License: MIT Total downloads CodeCov Test Coverage Coveralls Test Coverage QLTY Test Coverage QLTY Maintainability CI Heads CI Runtime Dependencies @ HEAD CI Current CI Truffle Ruby CI JRuby Deps Locked Deps Unlocked CI Test Coverage CI Style Apache SkyWalking Eyes License Compatibility Check

if ci_badges.map(&:color).detect { it != "green"} ☝️ let me know on Discord or RubyForum, as I may have missed the notification.


if ci_badges.map(&:color).all? { it == "green"} πŸ‘‡οΈ send money so I can do more of this. FLOSS maintenance is now my full-time job.

OpenCollective Backers OpenCollective Sponsors Sponsor Me on Github Liberapay Goal Progress Donate on PayPal Buy me a coffee Donate at ko-fi.com

πŸ‘£ How will this project approach the September 2025 hostile takeover of RubyGems? πŸš‘οΈ

I've summarized my thoughts in this blog post.

🌻 Synopsis Galtzo FLOSS Logo by Aboling0, CC BY-SA 4.0 ruby-lang Logo, Yukihiro Matsumoto, Ruby Visual Identity Team, CC BY-SA 2.5

Small, dependency-free primitives for parallel test runners: resolve the worker process count, track live worker pids in a file, record test runtimes to a log, and split test files into balanced worker groups weighted by those runtimes. Extracted from turbo_tests2 so the runner no longer leans on parallel_tests (whose supported Rubies have diverged from ours β€” this gem works on Ruby 2.4+ and every engine: MRI, JRuby, TruffleRuby).

The semantics mirror parallel_tests 3.5.2 through 5.8.0 for the surface runners actually use, with two deliberate improvements: the pid ledger re-reads the file before every write (the parallel_tests Pids class does not, which is a known source of lost worker pids), and grouping tie-breaks are deterministic.

πŸ’‘ Info you can shake a stick at

Tokens to Remember Gem name Gem namespace
Works with JRuby JRuby 10.0 Compat JRuby current Compat JRuby HEAD Compat
Works with Truffle Ruby Truffle Ruby 33.0 Compat Truffle Ruby current Compat
Works with MRI Ruby 4 Ruby current Compat Ruby HEAD Compat
Works with MRI Ruby 3 Ruby 3.0 Compat Ruby 3.1 Compat Ruby 3.2 Compat Ruby 3.3 Compat Ruby 3.4 Compat
Works with MRI Ruby 2 Ruby 2.4 Compat Ruby 2.5 Compat Ruby 2.6 Compat Ruby 2.7 Compat
Support & Community Join Me on Daily.dev's RubyFriends Get help from RubyForum Live Chat on Discord Get help from me on Upwork Get help from me on Codementor
Source Source on GitLab.com Source on CodeBerg.org Source on GitHub.com The best SHA: dQw4w9WgXcQ!
Documentation Current release on RubyDoc.info YARD on Galtzo.com Maintainer Blog GitLab Wiki GitHub Wiki
Compliance License: MIT Apache license compatibility: Category A πŸ“„ilo-declaration-img Security Policy Contributor Covenant 2.1 SemVer 2.0.0
Style Enforced Code Style Linter Keep-A-Changelog 1.0.0 Gitmoji Commits Compatibility appraised by: appraisal2
Maintainer πŸŽ–οΈ Follow Me on LinkedIn Follow Me on Ruby.Social Follow Me on Bluesky Contact Maintainer My technical writing
... πŸ’– Find Me on WellFound: Find Me on CrunchBase My LinkTree More About Me 🧊 πŸ™ πŸ›– πŸ§ͺ

Compatibility

The gem's declared runtime compatibility floor is MRI Ruby 2.4.0+, with concordant releases of JRuby and TruffleRuby. CI workflows and Appraisals are generated for MRI Ruby 2.4+. The current MRI CI lane runs on Linux and macOS. The test floor is configured by ruby.test_minimum in .kettle-jem.yml. When it is higher than the runtime floor, older runtime-compatible Rubies are not covered by the generated CI or Appraisal matrix.

kettle-dev Logo by Aboling0, CC BY-SA 4.0

The amazing test matrix is powered by the kettle-dev stack.

How kettle-dev manages complexity in tests
Gem Source Role Total downloads
appraisal2 GitHub multi-dependency Appraisal matrix generation Total downloads for appraisal2
appraisal2-rubocop GitHub RuboCop Appraisal generator integration Total downloads for appraisal2-rubocop
kettle-dev GitHub development, release, and CI workflow tooling Total downloads for kettle-dev
kettle-jem GitHub Appraisals & CI workflow templates Total downloads for kettle-jem
kettle-soup-cover GitHub SimpleCov coverage policy and reporting Total downloads for kettle-soup-cover
kettle-test GitHub standard test runner and coverage harness Total downloads for kettle-test
rubocop-lts GitHub Ruby-version-aware linting Total downloads for rubocop-lts
turbo_tests2 GitHub parallel test execution Total downloads for turbo_tests2

Federated DVCS

Find this repo on federated forges (Coming soon!)
Federated DVCS Repository Status Issues PRs Wiki CI
πŸ§ͺ galtzo-floss/runtime_groups on GitLab The Truth πŸ’š πŸ’š πŸ’š 🐭 Tiny Matrix
🧊 galtzo-floss/runtime_groups on CodeBerg An Ethical Mirror (Donate) πŸ’š πŸ’š βž– ⭕️ No Matrix
πŸ™ galtzo-floss/runtime_groups on GitHub Another Mirror πŸ’š πŸ’š πŸ’š πŸ’― Full Matrix

Enterprise Support

For enterprise support from the maintainer, use Upwork or CodeMentor.

Other support channels:

  • Ruby Users Forum
  • Live Chat on Discord

✨ Installation

Install the gem and add to the application's Gemfile by executing:

bundle add runtime_groups

If bundler is not being used to manage dependencies, install the gem by executing:

gem install runtime_groups

βš™οΈ Configuration

There is nothing to configure for the library itself β€” every entry point takes its inputs as arguments. The only environment contract is the worker count resolution default:

  • PARALLEL_TEST_PROCESSORS β€” read by RuntimeGroups.process_count when no explicit count is given (same variable parallel_tests uses, so existing CI configuration keeps working when a runner switches to this gem). A blank value is ignored; an invalid value raises RuntimeGroups::Error.

Resource-constrained runners (JVM engines especially: each turbo_tests2 worker is a full JVM whose default heap can be 1/4 of machine RAM) should cap the count explicitly rather than let it default to the core count.

πŸ”§ Basic Usage

require "runtime_groups"

# 1. Resolve the worker count: explicit count > PARALLEL_TEST_PROCESSORS >
#    Etc.nprocessors.
RuntimeGroups.process_count            # => e.g. 4
RuntimeGroups.process_count(2)         # explicit cap
RuntimeGroups.process_count(env: {}, env_key: "MY_WORKERS")

# 2. Record runtimes (typically called by a test runner's formatter as each
#    example group finishes).
log = RuntimeGroups::RuntimeLog.new("tmp/parallel_runtime_rspec.log")
log.log("./spec/models/user_spec.rb", 1.42)
RuntimeGroups::RuntimeLog.read("tmp/parallel_runtime_rspec.log")
# => {"./spec/models/user_spec.rb" => 1.42}

# 3. Group spec files into balanced worker groups, weighted by the recorded
#    runtimes (falling back to the average of known runtimes for files the
#    log has not seen).
groups = RuntimeGroups::Grouping.in_groups(
  Dir["spec/**/*_spec.rb"],
  4,
  runtime_log: "tmp/parallel_runtime_rspec.log"
)
# => [["./spec/slow_spec.rb"], ["./spec/a_spec.rb", ...], ..., []]

#    Weighting modes: :runtime (default), :filesize (bytes), :found (order).
#    :runtime raises RuntimeGroups::RuntimeLogTooSmallError when more than
#    `allowed_missing` (fraction, default 1.0) of the files are missing from
#    the log.
RuntimeGroups::Grouping.in_groups(files, 2, group_by: :filesize)

# 4. Track live worker pids in a file, scoped to a fan-out.
RuntimeGroups::PidFile.with(dir: "tmp") do |pid_path|
  ledger = RuntimeGroups::Pids.new(pid_path)
  4.times { |i| ledger.add(spawn_worker(i)) }
  ledger.to_a  # => [pid1, pid2, pid3, pid4] β€” read-before-write, so the
end            #    ledger is safe to share across processes

# 5. RSpec options-file passthrough (".rspec_parallel" et al.), previously
#    reachable only via parallel_tests internals.
RuntimeGroups::Options.spec_opts  # => "-O .rspec_parallel" or nil

🦷 FLOSS Funding

While galtzo-floss tools are free software and will always be, the project would benefit immensely from some funding. Raising a monthly budget of... "dollars" would make the project more sustainable.

We welcome both individual and corporate sponsors! We also offer a wide array of funding channels to account for your preferences. Currently, Open Collective is our preferred funding platform.

Corporate Sponsorship

If you're working in a company that's making significant use of galtzo-floss tools we'd appreciate it if you suggest to your company to become a galtzo-floss sponsor.

Individual Support

You can support the development of galtzo-floss tools via GitHub Sponsors, Liberapay, Open Collective, and PayPal.

Open Collective for Individuals

Support us with a monthly donation and help us continue our activities. [Become a backer]

NOTE: kettle-readme-backers updates this list every day, automatically.

No backers yet. Be the first!

Open Collective for Organizations

Become a sponsor and get your logo on our README on GitHub with a link to your site. [Become a sponsor]

NOTE: kettle-readme-backers updates this list every day, automatically.

No sponsors yet. Be the first!

Another way to support open-source

I’m driven by a passion to foster a thriving open-source community – a space where people can tackle complex problems, no matter how small. Revitalizing libraries that have fallen into disrepair, and building new libraries focused on solving real-world challenges, are my passions. I was recently affected by layoffs, and the tech jobs market is unwelcoming. I’m reaching out here because your support would significantly aid my efforts to provide for my family, and my farm (11 πŸ” chickens, 2 🐢 dogs, 3 🐰 rabbits, 8 πŸˆβ€ cats).

If you work at a company that uses my work, please encourage them to support me as a corporate sponsor. My work on gems you use might show up in bundle fund.

I’m developing a new library, floss_funding, designed to empower open-source developers like myself to get paid for the work we do, in a sustainable way. Please give it a look.

Floss-Funding.dev: πŸ‘‰οΈ No network calls. πŸ‘‰οΈ No tracking. πŸ‘‰οΈ No oversight. πŸ‘‰οΈ Minimal crypto hashing. πŸ’‘ Easily disabled nags

OpenCollective Backers OpenCollective Sponsors Sponsor Me on Github Liberapay Goal Progress Donate on PayPal Buy me a coffee Donate to my FLOSS efforts at ko-fi.com

πŸ” Security

See SECURITY.md.

🀝 Contributing

If you need some ideas of where to help, you could work on adding more code coverage, check issues or PRs, or use the gem and think about how it could be better.

We Keep A Changelog so if you make changes, remember to update it.

See CONTRIBUTING.md for more detailed instructions.

πŸš€ Release Instructions

See CONTRIBUTING.md.

Code Coverage

Coverage service badges

Coverage Graph

Coveralls Test Coverage

QLTY Test Coverage

πŸͺ‡ Code of Conduct

Everyone interacting with this project's codebases, issue trackers, chat rooms and mailing lists agrees to follow the Contributor Covenant 2.1.

🌈 Contributors

Contributors

Made with contributors-img.

Also see GitLab Contributors: https://gitlab.com/galtzo-floss/runtime_groups/-/graphs/main

πŸ“Œ Versioning

This library follows Semantic Versioning 2.0.0 for its public API where practical. For most applications, prefer the Pessimistic Version Constraint with two digits of precision.

For example:

spec.add_dependency("runtime_groups", "~> 0.0")
πŸ“Œ Is "Platform Support" part of the public API? More details inside.

Dropping support for a platform can be a breaking change for affected users. If a release changes supported platforms, it should be called out clearly in the changelog and versioned with that impact in mind.

To get a better understanding of how SemVer is intended to work over a project's lifetime, read this article from the creator of SemVer:

See CHANGELOG.md for a list of releases.

πŸ“„ License

The gem is available as open source under the terms of the MIT License: MIT.

Β© Copyright

See LICENSE.md for the official copyright notice.

Copyright holders
  • Copyright (c) 2026 Peter H. Boling

πŸ€‘ A request for help

Maintainers have teeth and need to pay their dentists. After getting laid off in an RIF in March, and encountering difficulty finding a new one, I began spending most of my time building open source tools. I'm hoping to be able to pay for my kids' health insurance this month, so if you value the work I am doing, I need your support. Please consider sponsoring me or the project.

To join the community or get help, use the RubyForum or Discord.

Ruby Users Forum Live Chat on Discord

To say "thanks!" ☝️ Join the community or πŸ‘‡οΈ send money.

Sponsor galtzo-floss/runtime_groups on Open Source Collective πŸ’Œ Sponsor me on GitHub Sponsors πŸ’Œ Sponsor me on Liberapay πŸ’Œ Donate on PayPal

Please give the project a star ⭐ β™₯.

Many parts of this project are actively managed by a kettle-jem smart template utilizing StructuredMerge.org merge contracts.

Thanks for RTFM. ☺️

Field Value
Package runtime_groups
Description πŸ—‚οΈ RuntimeGroups extracts the small parallel-runner primitives from turbo_tests2 β€” worker process count resolution, pid-file bookkeeping, runtime log recording, and runtime-weighted balanced file grouping β€” into a dependency-free gem that is engine-portable across MRI, JRuby, and TruffleRuby.
Homepage https://github.com/galtzo-floss/runtime_groups
Source https://github.com/galtzo-floss/runtime_groups
License MIT
Funding https://github.com/sponsors/pboling, https://ko-fi.com/pboling, https://liberapay.com/pboling/donate, https://opencollective.com/galtzo-floss, https://thanks.dev/u/gh/pboling, https://www.buymeacoffee.com/pboling