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

x/net/http2: stderr spam from running tests #22850

Closed
bradfitz opened this issue Nov 22, 2017 · 4 comments
Closed

x/net/http2: stderr spam from running tests #22850

bradfitz opened this issue Nov 22, 2017 · 4 comments
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@bradfitz
Copy link
Contributor

Tests shouldn't spam to stderr:

$ go test  -short
2017/11/22 20:01:28 protocol error: received DATA on a HEAD request
2017/11/22 20:01:31 protocol error: received DATA before a HEADERS frame
PASS
ok      golang.org/x/net/http2  5.150s

From:

=== RUN   TestTransportReadHeadResponseWithBody
2017/11/22 20:00:08 protocol error: received DATA on a HEAD request
--- PASS: TestTransportReadHeadResponseWithBody (0.00s)

...

=== RUN   TestTransportResponseDataBeforeHeaders
2017/11/22 20:01:54 protocol error: received DATA before a HEADERS frame
--- PASS: TestTransportResponseDataBeforeHeaders (0.00s)

/cc @tombergan

@bradfitz bradfitz added help wanted NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure. labels Nov 22, 2017
@bradfitz bradfitz added this to the Unreleased milestone Nov 22, 2017
@gregory-m
Copy link
Contributor

@bradfitz its enough to just add log.SetOutput(ioutil.Discard) to TestMain?

@bradfitz
Copy link
Contributor Author

@gregory-m, that's too big of a hammer. I'd prefer to do it per-test, and understand per-test whether we want no logging, or want something specific logged. We do that elsewhere already (maybe in net/http, if not x/net/http2)

@gregory-m
Copy link
Contributor

Ok, I will create CL.

@gopherbot
Copy link

Change https://golang.org/cl/80235 mentions this issue: http2: Discard logger output in invalid response tests

c3mb0 pushed a commit to c3mb0/net that referenced this issue Apr 2, 2018
In invalid response tests logger write error messages to stderr and spam
test output.

Since we know response are invalid in these tests we can safely discard
logger output.

Fixes golang/go#22850

Change-Id: Id8c97be910f0cf7dbe2380ba632960364bc8478b
Reviewed-on: https://go-review.googlesource.com/80235
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
@golang golang locked and limited conversation to collaborators Nov 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
Development

No branches or pull requests

3 participants