🙈 Update coverage ignore statements for race conditions#408
Merged
Conversation
Robdel12
approved these changes
Jul 15, 2021
Contributor
Robdel12
left a comment
There was a problem hiding this comment.
🏁 Happy day when windows coverage no longer trolls us
samarsault
pushed a commit
that referenced
this pull request
Mar 3, 2023
Bumps [@percy/core](https://github.com/percy/cli/tree/HEAD/packages/core) from 1.0.0-beta.65 to 1.0.0-beta.67. - [Release notes](https://github.com/percy/cli/releases) - [Commits](https://github.com/percy/cli/commits/v1.0.0-beta.67/packages/core) --- updated-dependencies: - dependency-name: "@percy/core" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this?
Sometimes, we get an occasional flakey CI failure due to missing branch coverage, which doesn't highlight which line number the coverage was missed for in the CI summary.
The reason that coverage is flakey but tests pass is likely due to a close enough assertion. For example, a test that asserts the page was closed might test for
/closed/because sometimes the message isBrowser closedinstead ofPage closed(both messages mean the page is closed, so the test is still accurate).All page/browser errors are handled in one of two places, and the resulting handling and desired outcome is the same. There was already a coverage ignore statement on one handler, and another nested within the second handler. Both ignore statements were adjusted to reflect that they race with one another.
Another possible solution here would be to pull out this error handling into a shared function. That way it wouldn't matter which browser/page method handled the error since the same coverage paths would be taken in either case. I didn't do that now since there was already coverage ignore statements in these places and it was quicker to adjust them.