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

net/http: test timeout in TestCancelRequestWhenSharingConnection #56587

Open
gopherbot opened this issue Nov 4, 2022 · 4 comments
Open

net/http: test timeout in TestCancelRequestWhenSharingConnection #56587

gopherbot opened this issue Nov 4, 2022 · 4 comments
Assignees
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@gopherbot
Copy link

gopherbot commented Nov 4, 2022

#!watchflakes
post <- pkg == "net/http" && test == "TestCancelRequestWhenSharingConnection" && `panic: test timed out`

Issue created automatically to collect these failures.

Example (log):

2022/11/03 23:02:53 http2: server: error reading preface from client 127.0.0.1:36996: bogus greeting "CONNECT golang.fake.tld:"
2022/11/03 23:02:53 http2: server: error reading preface from client 127.0.0.1:58574: bogus greeting "CONNECT golang.fake.tld:"
2022/11/03 23:02:53 http: TLS handshake error from 127.0.0.1:42806: write tcp 127.0.0.1:33837->127.0.0.1:42806: i/o timeout
2022/11/03 23:02:53 http: TLS handshake error from 127.0.0.1:60338: EOF
2022/11/03 23:02:53 http: TLS handshake error from 127.0.0.1:51204: EOF
2022/11/03 23:02:54 http: TLS handshake error from 127.0.0.1:54592: read tcp 127.0.0.1:33065->127.0.0.1:54592: use of closed network connection
2022/11/03 23:02:54 http: TLS handshake error from 127.0.0.1:54594: read tcp 127.0.0.1:33065->127.0.0.1:54594: use of closed network connection
2022/11/03 23:02:54 http: TLS handshake error from 127.0.0.1:54588: read tcp 127.0.0.1:33065->127.0.0.1:54588: use of closed network connection
2022/11/03 23:02:54 http: TLS handshake error from 127.0.0.1:54602: read tcp 127.0.0.1:33065->127.0.0.1:54602: use of closed network connection
2022/11/03 23:02:54 http: TLS handshake error from 127.0.0.1:54586: read tcp 127.0.0.1:33065->127.0.0.1:54586: use of closed network connection
...
panic: test timed out after 3m0s
running tests:
	TestCancelRequestWhenSharingConnection (2m58s)
	TestCancelRequestWhenSharingConnection/h1 (2m57s)

goroutine 24537 [running]:
panic({0x841b80, 0xc000612370})
	/tmp/workdir-host-linux-amd64-wsl/go/src/runtime/panic.go:987 +0x3bb fp=0xc000694f10 sp=0xc000694e50 pc=0x437ebb
testing.(*M).startAlarm.func1()
	/tmp/workdir-host-linux-amd64-wsl/go/src/testing/testing.go:2223 +0x3b9 fp=0xc000694fe0 sp=0xc000694f10 pc=0x503259
runtime.goexit()
	/tmp/workdir-host-linux-amd64-wsl/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000694fe8 sp=0xc000694fe0 pc=0x46d041
created by time.goFunc
	/tmp/workdir-host-linux-amd64-wsl/go/src/time/sleep.go:176 +0x32

watchflakes

@gopherbot gopherbot added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 4, 2022
@gopherbot
Copy link
Author

gopherbot commented Nov 4, 2022

Found new dashboard test flakes for:

#!watchflakes
post <- pkg == "net/http" && test == ""
2022-11-03 15:18 linux-amd64-wsl go@a367981b net/http (log)
2022/11/03 23:02:53 http2: server: error reading preface from client 127.0.0.1:36996: bogus greeting "CONNECT golang.fake.tld:"
2022/11/03 23:02:53 http2: server: error reading preface from client 127.0.0.1:58574: bogus greeting "CONNECT golang.fake.tld:"
2022/11/03 23:02:53 http: TLS handshake error from 127.0.0.1:42806: write tcp 127.0.0.1:33837->127.0.0.1:42806: i/o timeout
2022/11/03 23:02:53 http: TLS handshake error from 127.0.0.1:60338: EOF
2022/11/03 23:02:53 http: TLS handshake error from 127.0.0.1:51204: EOF
2022/11/03 23:02:54 http: TLS handshake error from 127.0.0.1:54592: read tcp 127.0.0.1:33065->127.0.0.1:54592: use of closed network connection
2022/11/03 23:02:54 http: TLS handshake error from 127.0.0.1:54594: read tcp 127.0.0.1:33065->127.0.0.1:54594: use of closed network connection
2022/11/03 23:02:54 http: TLS handshake error from 127.0.0.1:54588: read tcp 127.0.0.1:33065->127.0.0.1:54588: use of closed network connection
2022/11/03 23:02:54 http: TLS handshake error from 127.0.0.1:54602: read tcp 127.0.0.1:33065->127.0.0.1:54602: use of closed network connection
2022/11/03 23:02:54 http: TLS handshake error from 127.0.0.1:54586: read tcp 127.0.0.1:33065->127.0.0.1:54586: use of closed network connection
...
panic: test timed out after 3m0s
running tests:
	TestCancelRequestWhenSharingConnection (2m58s)
	TestCancelRequestWhenSharingConnection/h1 (2m57s)

goroutine 24537 [running]:
panic({0x841b80, 0xc000612370})
	/tmp/workdir-host-linux-amd64-wsl/go/src/runtime/panic.go:987 +0x3bb fp=0xc000694f10 sp=0xc000694e50 pc=0x437ebb
testing.(*M).startAlarm.func1()
	/tmp/workdir-host-linux-amd64-wsl/go/src/testing/testing.go:2223 +0x3b9 fp=0xc000694fe0 sp=0xc000694f10 pc=0x503259
runtime.goexit()
	/tmp/workdir-host-linux-amd64-wsl/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000694fe8 sp=0xc000694fe0 pc=0x46d041
created by time.goFunc
	/tmp/workdir-host-linux-amd64-wsl/go/src/time/sleep.go:176 +0x32

watchflakes

@bcmills
Copy link
Member

bcmills commented Nov 4, 2022

Duplicate of #55226

@ZekeLu
Copy link
Contributor

ZekeLu commented Nov 9, 2022

goroutine 1956 [chan receive, 2 minutes]:
...
net/http_test.testCancelRequestWhenSharingConnection(0xc0006ada00, {0x8c95d2, 0x2})
	/tmp/workdir-host-linux-amd64-wsl/go/src/net/http/transport_test.go:6519 +0x233 fp=0xc0006a4f28 sp=0xc0006a4e78 pc=0x7fc0f3
...

putidlec := make(chan chan struct{})
go func() {
defer wg.Done()
ctx := httptrace.WithClientTrace(context.Background(), &httptrace.ClientTrace{
PutIdleConn: func(error) {
// Signal that the idle conn has been returned to the pool,
// and wait for the order to proceed.
ch := make(chan struct{})
putidlec <- ch
<-ch
},
})
req, _ := NewRequestWithContext(ctx, "GET", ts.URL, nil)
res, err := client.Do(req)
if err == nil {
res.Body.Close()
}
if err != nil {
t.Errorf("request 1: got err %v, want nil", err)
}
}()
// Wait for the first request to receive a response and return the
// connection to the idle pool.
r1c := <-reqc
close(r1c)
idlec := <-putidlec

Line 6519 blocks on reading from the putidlec. Which means that the PutIdleConn trace is not called.

This failure mode is different from #55226.

I think this watchflakes pattern could be updated to:

#!watchflakes
post <- pkg == "net/http" && test == "TestCancelRequestWhenSharingConnection" && "panic: test timed out"

The suggested title is: net/http: test timeout in TestCancelRequestWhenSharingConnection

@bcmills bcmills added this to the Backlog milestone Nov 9, 2022
@bcmills bcmills reopened this Nov 9, 2022
@bcmills bcmills changed the title net/http: unrecognized failures net/http: test timeout in TestCancelRequestWhenSharingConnection Nov 9, 2022
@gopherbot

This comment has been hidden.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Status: Done
Development

No branches or pull requests

4 participants