I think this comes down to the level of confidence in generating the same sequence of random numbers across environments. (Disclaimer: I believe I wrote this code due to a failure on ruby 1.8 on CI that I was unable to reproduce locally, which this code did not provide insight into and which I later found and resolved without reproducing the exact failure).

I think it's fair to look at refactoring this. I think it is largely unnecessary at this point. The following paragraph attempts to explain the logic in more detail, if you're interested.

The goal of this code was to ensure that the seed that is returned here is actually resulting in random spec ordering and that we didn't manage to pick one of the few random numbers that would result in leaving everything unordered. Ideally, the `while` loop should never get hit, but is there for insurance. There is also an expectation that enforces that this seed is providing randomization.