Skip to content

Harden systest log filenames against concurrent-writer collisions - #1291

Merged
mkarlesky merged 1 commit into
next_versionfrom
fix/systest-log-collision-hardening
Sep 15, 2026
Merged

mkarlesky merged 1 commit into
next_versionfrom
fix/systest-log-collision-hardening

Conversation

@mkarlesky

Copy link
Copy Markdown
Member

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's after(:each) hook writes each system test's result log to systests/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 use Dir.mktmpdir and 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): add Process.pid and switch to microsecond-precision timestamps.

Test plan

  • Spot check: launched two RSpec processes concurrently against the same checkout, both running the identical test with 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.
  • Single-file diff, no behavior change to log content or pass/fail logic.
  • Full CI suite (backstop for full-suite regression — this change is scoped to log-filename construction only, not exercised meaningfully by a partial local run).

🤖 Generated with Claude Code

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>
@mkarlesky
mkarlesky merged commit ceb433a into next_version Sep 15, 2026
20 checks passed
@mkarlesky
mkarlesky deleted the fix/systest-log-collision-hardening branch September 15, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant