Harden systest log filenames against concurrent-writer collisions - #1291
Merged
Merged
Conversation
Second-precision timestamps with no PID meant two RSpec processes writing a log for identically-described tests in the same UTC second would silently overwrite one another -- a latent risk for any future system-test parallelization. Mirrors simplecov_boot.rb's own PID+microsecond resultset naming, which already solves this for coverage data. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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
Prep work for a future CI system-test sharding effort (deferred, not part of this PR): closes a real latent collision risk found while investigating that sharding design.
spec/support/system/spec_system_helper.rb'safter(:each)hook writes each system test's result log tosystests/systest.<pass|fail>.<test_name>.<timestamp>.log, where<timestamp>was second-precision with no PID. Two RSpec processes writing a log for identically-described tests within the same UTC second would silently overwrite one another.SystemContext's own per-test project directories already useDir.mktmpdirand are unaffected — this was the one non-collision-proof path in the harness.Fix mirrors the pattern this codebase already uses, proven safe, for SimpleCov's per-child-process resultset directories (
spec/support/system/simplecov_boot.rb): addProcess.pidand switch to microsecond-precision timestamps.Test plan
CEEDLING_SYSTEM_TEST_KEEP=all— before the fix this would collide; confirmed two distinct log files are now produced instead of one clobbering the other.🤖 Generated with Claude Code