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

Comments

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Nov 22, 2017

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

@gregory-m

This comment has been minimized.

Copy link
Contributor

@gregory-m gregory-m commented Nov 27, 2017

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

@bradfitz

This comment has been minimized.

Copy link
Contributor Author

@bradfitz bradfitz commented Nov 27, 2017

@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

This comment has been minimized.

Copy link
Contributor

@gregory-m gregory-m commented Nov 27, 2017

Ok, I will create CL.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Nov 28, 2017

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.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.