Repository navigation
net/http: port clientserver_test.go from TestTransportDiscardsUnneededConns - #723
Merged
Merged
Conversation
…dConns Port the next nine tests of clientserver_test.go, down to TestBadResponseAfterReadingBody. The nil subtest of TestInterruptWithPanic is left out, since burrow has no panicnil setting.
23 of 27 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
This ports the next nine tests of Go 1.27's
net/http/clientserver_test.go, fromTestTransportDiscardsUnneededConnsdown toTestBadResponseAfterReadingBody. They go intests/http_clientserver_test.cand use the harness from #722. This is part of #6.TestTransportDiscardsUnneededConnsTestTransportGCRequestTestTransportRejectsInvalidHeadersTestInterruptWithPanicTestH12_AutoGzipWithDumpResponseTestCloseIdleConnectionsTestNoSniffExpectRequestBodyTestServerUndeclaredTrailersTestBadResponseAfterReadingBodyNot in Go
Where the code departs from Go's, it has a "Not in Go" comment. The main ones:
nilsubtest is left out. It setsGODEBUG=panicnil=1, and burrow has no such setting, sopanic(nil)always carries a value, which is what Go does without it.next_protosup front. Go's transport adds it to the shared config itself, but burrow's only puts it in the clone each of its own connections gets. The wrapper conn also keeps the pieces the transport'sfree_connhook needs to free them.Posttakes anIoReader, which can't say it is also a closer, so the test builds the requestPostwould make and sets the counting closer as its body by hand.Tests
I ran these on server3 (Linux, clang) at 44f77eb. The job runs the static checks, then builds
http_clientserver_testandhttptest_testthree times: plain, with ASan+UBSan, and with TSan. The log, verbatim:The "verbose" line counts the
--- PASS,--- SKIPand--- FAILlines from a-test.v -test.shortrun, subtests included. It was 69 before this change, and the new tests add 31. The two count=5 lines run the plain build with-test.short -test.count=5. The three tsan lines run the TSan build ofhttp_clientserver_testwith-test.count=5and without-test.short.What's next
The rest of
clientserver_test.go, fromTestWriteHeader0.TestClientServerTLSConnWrapperneeds the server and transport to take the TLS state from a conn that isn't aTlsConn, so that will come with its own library change.