PAYMENTS-12054 Fix the CI bundler cache and the puma spec port collisions - #46
Merged
Merged
Conversation
WillemHoman
force-pushed
the
PAYMENTS-12054-ci-and-spec-hygiene
branch
from
August 10, 2026 10:25
5f4d810 to
60cade6
Compare
…each example Bind the puma server specs to an ephemeral port
WillemHoman
force-pushed
the
PAYMENTS-12054-ci-and-spec-hygiene
branch
from
August 10, 2026 11:08
60cade6 to
8e52431
Compare
… since there is no lockfile
WillemHoman
force-pushed
the
PAYMENTS-12054-ci-and-spec-hygiene
branch
from
August 10, 2026 11:11
8e52431 to
421c05a
Compare
WillemHoman
marked this pull request as ready for review
August 10, 2026 11:12
j05h
reviewed
Aug 10, 2026
j05h
approved these changes
Aug 10, 2026
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6dc0ac3. Configure here.
added 2 commits
August 11, 2026 13:25
…they can be cleaned up
…rt in the spec, ask the kernel for a free port and use it to eliminate the chance of collisions
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.

Jira: PAYMENTS-12054
N.B. no Changelog updates as will have a release with #45
What? Why?
Fixes
1.
restore_cachehas been failing on every job of every buildorbs/internal-ruby.yml builds its key as
<cache_key>-{{ arch }}-{{ checksum <checksumfile> }}, andchecksumfiledefaults to
Gemfile.lock.This repo ships no lockfile, it is gitignored so it always resulted in a cache miss.
The
Gemfileis the stable file that does exist so it is used as thechecksumfile.Reduces the build by ~ 5 mins.
2. The puma specs collide on ports
default_portwas9800 + rand(100)Constructing the server binds a real listener.
Three examples use it, so they collide about 3% of the time, raising an
Errno::EADDRINUSE.How was it tested?
CI
Note
Low Risk
CI and test-only changes with no production runtime behavior; low risk aside from verifying cache keys still isolate Ruby versions correctly.
Overview
Fixes CircleCI bundler cache restore failures and intermittent Puma server spec port collisions.
CI: Sets shared
checksumfile: Gemfile(this repo has no committedGemfile.lock) and distinctcache_keyvalues per Ruby job (gem-cache-ruby-3_3,3_4,4_0) so the internal-ruby orb can compute cache keys without error and restore gems reliably.Specs: Puma
Serverexamples now bind port 0 for ephemeral listeners instead of9800 + rand(100), track started servers, and close binders in anafterhook. The configured-port example probes a free port viaTCPServeron port 0 so assertions still target a known port without colliding with other examples.Reviewed by Cursor Bugbot for commit 31bef9f. Bugbot is set up for automated code reviews on this repo. Configure here.