-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cover: Gracefully handle failures to collect coverage data
On platforms that support native coverage (introduced in Erlang/OTP 27), the `cover` module did not properly handle failed calls to `code:get_coverage/2`. The call to that function will fail if the module in question has been reloaded or unloaded. For example, if `cover:export/1` was called and a module had been reloaded on a remote node (for example by `meck`), the `cover:export/1` call would never return. Because the current API for `cover` has no good way to report this kind of error, we will fix the issue by logging the failed call using the `logger` module and otherwise ignore the failure. That implies that there will be no coverage information for modules that have been reloaded. That is compatible with the behavior of `cover` prior to Erlang/OTP 27. Closes #8691
- Loading branch information
Showing
2 changed files
with
51 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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