-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime/coverage: inaccurate coverage with covermode=atomic on js/wasm #68031
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Similar Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
I confirmed this error exists for go-tip |
The wasm wrapper I used is https://github.com/golang/go/blob/master/misc/wasm/go_js_wasm_exec |
@thanm Can you check this issue? |
@seankhliao I've test against |
your reproduction step uses too many unnecessary dependencies like python.
and as far as I can tell, it reproduces only with atomic or count, not set. |
Yes, covermode set works correctly. |
Not sure if I see a bug here, things look like they are working as intended. First screendump from the HTML report with atomic mode: Note the color of "low coverage" on the left. This shade is chosen (I presume) to be slightly above the gray value of "not tracked". Now here's a screendump of the func body: I invite you to squint carefully and compare the shade of the first line ("MarshallJavaScript") with the shade of the second line ("var sections []any"). The color of the first line corresponds to that of "untracked" from the legend, and the color of the second line corresponds to "low coverage" from the legend. Note that "low" does not mean zero. With that said, it is clear that the status quo is confusing. Maybe we need to choose a different color scheme, something that makes it easier to tell the difference between "low" and "zero" more reliably. Let me know what you think. |
Sorry, I realise this may have been a mistake. |
Go version
go version go1.22.4 windows/amd64
Output of
go env
in your module/workspace:What did you do?
Steps to Reproduction:
Sorry I couldn't reproduce the problem in a smaller sample.
What did you see happen?
The script described above above will generate a
unit.profile
coverage file.with
go tool cover -html="unit.profile"
, got a pageNone of the statements after
append
are computed into coverage. The programme didn't crash either, because the result in test turned out to be success.What did you expect to see?
Coverage should be able to correctly report all lines and files that are run.
The text was updated successfully, but these errors were encountered: