Repository navigation
Speed up CI: faster test job startup and runtime-balanced spec groups - #1628
Merged
Merged
Conversation
- Replace the LocalStack service with Floci (floci/floci:2.3.0), a much smaller LocalStack-compatible emulator that is ready almost instantly. - Set METADATA_STORAGE_BUCKET_NAME in CI so the S3 metadata storage path is exercised again (it has been off since the env var defaulted to ""). - Split specs into 8 jobs grouped by recorded runtime (spec/parallel_runtime_rspec.log) instead of 16 jobs grouped by file count. Each job uploads its runtimes so the log can be refreshed. - Rewrite the EventsPreloader chunking spec to stub CHUNK_SIZE instead of creating 1,100 DOIs (80s -> <1s), and assert that events spanning chunks are attached once to each DOI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tests no longer wait for lint to pass, so results arrive sooner and a lint or bundler-audit failure doesn't hide test results. A new push to a PR now cancels the run still going on the previous commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Per-file runtimes from the first green 8-job run on this branch (actions run 39939499539), merged from the rspec-runtime-* artifacts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Should this log file be checked in?
Contributor
Author
There was a problem hiding this comment.
Yes. It is used in the specs to distribute the tests based on total runtime
richardhallett
left a comment
Contributor
There was a problem hiding this comment.
I guess fine, the change to floci is interesting choice, not that I'm in love with localstack, but for CI I guess we can give it a go.
richardhallett
approved these changes
Oct 27, 2026
wendelfabianchinsamy
approved these changes
Oct 27, 2026
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.
Purpose
Make the CI test suite finish faster and use fewer runner minutes: start every test job faster, and spread the specs evenly across fewer jobs.
Approach
Every parallel test job spends about 1m20s setting up before any spec runs. Most of that is GitHub Actions pulling the service images one after another and waiting for them to report healthy. LocalStack, used only as an S3 stand-in, was the slowest service in each job: about 24s to pull its 1.78 GB image, then about 13s waiting for its health check. That cost was paid by all 16 jobs on every run.
This PR replaces LocalStack with Floci, a LocalStack-compatible S3 emulator on the same port 4566. Its image is about 346 MB, and it reports healthy in under a second. That cuts setup time in every test job. The app talks to it through the same
AWS_ENDPOINT_URL_S3settings, so no app code changes.Specs were also split poorly:
parallel_testgrouped them by file count, so job times ranged from about 10s to 165s while every job paid the full setup cost. Specs are now grouped by recorded runtime across 8 jobs instead of 16. One spec (events_preloader_spec.rb) alone took about 80s, which set the minimum time for any job, so it has been rewritten to test the same behaviour in under a second.Key Modifications
.github/workflows/parallel_ci.yml:localstackservice withfloci(floci/floci:2.3.0) to cut setup time in every test job.METADATA_STORAGE_BUCKET_NAME: metadatain the Test step, so the S3 metadata storage specs run against the emulator again. They have been skipped in CI since that variable started defaulting to"".parallel_testto--group-by runtime --runtime-log spec/parallel_runtime_rspec.log.ParallelTests::RSpec::RuntimeLogger) and uploads them as arspec-runtime-<index>artifact (14-day retention) after a successful run.spec/parallel_runtime_rspec.log(new): per-file runtimes used to balance the groups. It is seeded from a full local run.spec/services/events_preloader_spec.rb: the chunking spec used to create 1,100 DOIs (~80s). It now usesstub_constto setCHUNK_SIZEto 2 and reuses the spec's three DOIs. It also asserts what the old spec did not: the preloader makes one query per chunk, and an event spanning two chunks is attached exactly once to each DOI.Important Technical Details
spec/requests/datacite_dois/get_spec.rb, the slowest remaining file.all_events.uniq!fromEventsPreloadermakes the new chunking spec fail.docker-compose*.ymlstill uses LocalStack. Switching those is left for a follow-up.Types of changes
Reviewer, please remember our guidelines:
🤖 Generated with Claude Code