Can rspec preserve seed state across infrequent test runs without manual intervention?
0 reputation · 27 May 2025, 16:44 UTC
This question investigates how rspec's --seed flag behaves when test suites execute at low frequency, such as in sporadic manual runs or dormant CI pipelines. The goal is to determine whether deterministic random test ordering can be reliably preserved across run gaps without external state management, and what version-dependent factors influence this outcome. rspec documents that --seed NUMBER fixes the random seed for reproducibility, but the documentation does not explicitly address seed persistence when runs are separated by extended intervals. Uncertainty remains around whether the seed state resets, is stored in metadata, or requires explicit re-specification each invocation, particularly across rspec 3.x and 4.x where internal ordering mechanisms and output formats changed. The investigation focuses on the practical limits of seed-based determinism in workloads that do not run on every commit.
Specific questions for further investigation include:
- Does the
--seedvalue persist across run intervals, or does rspec reset it implicitly? - How do rspec 3.x and 4.x differ in seed handling for infrequent test executions?
- Is there a documented mechanism to lock seed state without modifying the test suite configuration?