class RSpec::Core::Bisect::ForkRunner

A Bisect runner that runs requested subsets of the suite by forking sub-processes. The main process bootstraps RSpec and the application environment (including preloading files specified via ‘–require`) so that the individual spec runs do not have to re-pay that cost. Each spec run happens in a forked process, ensuring that the spec files are not loaded in the main process.

For most projects, bisections that use ‘ForkRunner` instead of `ShellRunner` will finish significantly faster, because the `ShellRunner` pays the cost of booting RSpec and the app environment on every run of a subset. In contrast, `ForkRunner` pays that cost only once.

However, not all projects can use ‘ForkRunner`. Obviously, on platforms that do not support forking (e.g. Windows), it cannot be used. In addition, it can cause problems for some projects that put side-effectful spec bootstrapping logic that should run on every spec run directly at the top level in a file loaded by `–require`, rather than in a `before(:suite)` hook. For example, consider a project that relies on some top-level logic in `spec_helper` to boot a Redis server for the test suite, intending the Redis bootstrapping to happen on every spec run. With `ShellRunner`, the bootstrapping logic will happen for each run of any subset of the suite, but for `ForkRunner`, such logic will only get run once, when the `RunDispatcher` boots the application environment. This might cause problems. The solution is for users to move the bootstrapping logic into a `before(:suite)` hook, or use the slower `ShellRunner`.

@private