Skip to content

Forked process doing cleanup at_exit can cause duplicate coverage reports #228

Open
@HerbCSO

Description

@HerbCSO

When you run bundle exec rspec on this repo (that is the most minimal test case I can come up with), there will be two SimpleCov reports generated, with very different coverage percentages. The fact that the UtilityConfig class has a forked process that is cleaned up in an at_exit call seems to cause some sort of race condition in SimpleCov (I have not been able to figure out where this occurs).

Sample output on my system:

> bundle exec rspec
.

Finished in 2 seconds
1 example, 0 failures

Randomized with seed 51923

Coverage report generated for RSpec to /opt/pose/test-simplecov/coverage. 23 / 25 LOC (92.0%) covered.
Coverage (92.00%) is below the expected minimum coverage (95.00%).
Coverage report generated for RSpec to /opt/pose/test-simplecov/coverage. 5 / 25 LOC (20.0%) covered.

The second Coverage report is wrong. If it wasn't for the fact that it overwrites the results of the first (correct) one, I wouldn't mind so much... ;]

Please let me know if I can help with any other input/background.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions