fix(spec): make factory sequences unique per process#8504
Open
LWS49 wants to merge 1 commit into
Open
Conversation
Specs commit (use_transactional_fixtures is false), so a bare per-second timestamp collides whenever two rspec processes start within the same second, tripping unique constraints. Append a random suffix per process.
LWS49
force-pushed
the
lws49/feat-marketplace-pr6a-factories
branch
from
July 22, 2026 05:39
f8c6959 to
8e63f2b
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
Spec factories built a bare per-second timestamp into their sequences. Specs run with
use_transactional_fixturesdisabled, so two rspec processes that start within the same second generate identical values and trip unique constraints. Appending a random per-process suffix makes the sequences unique regardless of when a process starts.Regression prevention
Covers two sequences that carried a bare timestamp: instance hosts and user email. The values only ever need to be unique, never stable or predictable, so no spec depends on their format. Exercised by every parallel rspec run.