Skip to content
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

cmd/go: tests that panic or exit are marked as passing when -json flag is used [1.14 backport] #37671

Closed
gopherbot opened this issue Mar 4, 2020 · 3 comments
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge release-blocker
Milestone

Comments

@gopherbot
Copy link
Contributor

@dmitshur requested issue #37555 to be considered for backport to the next 1.14 minor release.

This reproduces on tip as well. I'll change this issue to Go 1.15 milestone, and ask @gopherbot to please backport this to Go 1.14. Based on information so far, this looks like a serious bug that likely doesn't have a viable workaround.

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Mar 4, 2020
@gopherbot gopherbot added this to the Go1.14.1 milestone Mar 4, 2020
@dmitshur dmitshur added CherryPickApproved Used during the release process for point releases and removed CherryPickCandidate Used during the release process for point releases labels Mar 5, 2020
@dmitshur
Copy link
Contributor

dmitshur commented Mar 5, 2020

Approving because this is a serious problem without a workaround.

@gopherbot
Copy link
Contributor Author

Change https://golang.org/cl/222658 mentions this issue: [release-branch.go1.14] cmd/go: make go test -json report failures for panicking/exiting tests

@gopherbot
Copy link
Contributor Author

Closed by merging 76a6adc to release-branch.go1.14.

gopherbot pushed a commit that referenced this issue Mar 9, 2020
…r panicking/exiting tests

'go test -json' should report that a test failed if the test binary
did not exit normally with status 0. This covers panics, non-zero
exits, and abnormal terminations.

These tests don't print a final result when run with -test.v (which is
used by 'go test -json'). The final result should be "PASS" or "FAIL"
on a line by itself. 'go test' prints "FAIL" in this case, but
includes error information.

test2json was changed in CL 192104 to report that a test passed if it
does not report a final status. This caused 'go test -json' to report
that a test passed after a panic or non-zero exit.

With this change, test2json treats "FAIL" with error information the
same as "FAIL" on a line by itself. This is intended to be a minimal
fix for backporting, but it will likely be replaced by a complete
solution for #29062.

Fixes #37671
Updates #37555
Updates #29062
Updates #31969

Change-Id: Icb67bcd36bed97e6a8d51f4d14bf71f73c83ac3d
Reviewed-on: https://go-review.googlesource.com/c/go/+/222243
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
(cherry picked from commit 5ea58c6)
Reviewed-on: https://go-review.googlesource.com/c/go/+/222658
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
@golang golang locked and limited conversation to collaborators Mar 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge release-blocker
Projects
None yet
Development

No branches or pull requests

2 participants