Skip to content

Inconsistent / intermittent coverage with SimpleCov 0.22.0 + parallel_tests after upgrading Rails 7.1 → 7.2 #1021

@sullyvannunes

Description

@sullyvannunes

After upgrading a Rails app from 7.1.5.2 → 7.2.2.1 I started seeing coverage drop and fluctuate between runs when running the test suite in parallel. The project uses parallel_tests (parallel_rspec) and SimpleCov 0.22.0. Prior to the Rails bump the suite reported 100% coverage consistently; after the bump the coverage value is lower and different on each run.

I have tried the obvious fixes (moving SimpleCov.start earlier, per-worker command_name, collating results, forcing eager load during coverage runs) but the problem persists. Below are exact config snippets, how I run tests, what I tried and questions / debugging requests — any help or suggestions would be appreciated.

Environment / relevant gems

Rails: 7.2.2.1 (previously 7.1.5.2)
SimpleCov: 0.22.0
Test runner: rspec + parallel_tests

CI command used:

RAILS_ENV=test COVERAGE=1 bin/rails parallel:spec

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions