Closed avstrong closed 2 years ago
Hi,
Running uber-go/goleak, I found that this example
Run go test ./internal/ -race -v -count=1
func TestR(t *testing.T) { defer goleak.VerifyNone(t) client := twilio.NewRestClientWithParams( twilio.ClientParams{ Username: "mydata", Password: "mydata", }, ) params := &openapi.CreateMessageParams{} params.SetFrom("+15005550006") params.SetTo("+79003223232") params.SetBody("10") _, err := client.Api.CreateMessage(params) require.NoError(t, err) }
=== RUN TestR leaks.go:78: found unexpected goroutines: [Goroutine 36 in state IO wait, with internal/poll.runtime_pollWait on top of the stack: goroutine 36 [IO wait]: internal/poll.runtime_pollWait(0x9f627f8, 0x72) /usr/local/opt/go/libexec/src/runtime/netpoll.go:234 +0x89 internal/poll.(*pollDesc).wait(0xc000192398, 0xc0000c6000, 0x0) /usr/local/opt/go/libexec/src/internal/poll/fd_poll_runtime.go:84 +0xbd internal/poll.(*pollDesc).waitRead(...) /usr/local/opt/go/libexec/src/internal/poll/fd_poll_runtime.go:89 internal/poll.(*FD).Read(0xc000192380, {0xc0000c6000, 0x12cc, 0x12cc}) /usr/local/opt/go/libexec/src/internal/poll/fd_unix.go:167 +0x419 net.(*netFD).Read(0xc000192380, {0xc0000c6000, 0x12cc, 0x12cc}) /usr/local/opt/go/libexec/src/net/fd_posix.go:56 +0x51 net.(*conn).Read(0xc000094000, {0xc0000c6000, 0x12cc, 0x12cc}) /usr/local/opt/go/libexec/src/net/net.go:183 +0xb1 crypto/tls.(*atLeastReader).Read(0xc00038e060, {0xc0000c6000, 0x12cc, 0x12cc}) /usr/local/opt/go/libexec/src/crypto/tls/conn.go:777 +0x86 bytes.(*Buffer).ReadFrom(0xc000098278, {0x14f13a0, 0xc00038e060}) /usr/local/opt/go/libexec/src/bytes/buffer.go:204 +0x113 crypto/tls.(*Conn).readFromUntil(0xc000098000, {0x9ef5100, 0xc000094000}, 0x5) /usr/local/opt/go/libexec/src/crypto/tls/conn.go:799 +0x1df crypto/tls.(*Conn).readRecordOrCCS(0xc000098000, 0x0) /usr/local/opt/go/libexec/src/crypto/tls/conn.go:606 +0x3fe crypto/tls.(*Conn).readRecord(...) /usr/local/opt/go/libexec/src/crypto/tls/conn.go:574 crypto/tls.(*Conn).Read(0xc000098000, {0xc00034c000, 0x1000, 0x0}) /usr/local/opt/go/libexec/src/crypto/tls/conn.go:1277 +0x29c net/http.(*persistConn).Read(0xc00015aa20, {0xc00034c000, 0x1000, 0x1000}) /usr/local/opt/go/libexec/src/net/http/transport.go:1926 +0x110 bufio.(*Reader).fill(0xc000300c00) /usr/local/opt/go/libexec/src/bufio/bufio.go:101 +0x294 bufio.(*Reader).Peek(0xc000300c00, 0x1) /usr/local/opt/go/libexec/src/bufio/bufio.go:139 +0xcc net/http.(*persistConn).readLoop(0xc00015aa20) /usr/local/opt/go/libexec/src/net/http/transport.go:2087 +0x2db created by net/http.(*Transport).dialConn /usr/local/opt/go/libexec/src/net/http/transport.go:1747 +0x2ef8 Goroutine 37 in state select, with net/http.(*persistConn).writeLoop on top of the stack: goroutine 37 [select]: net/http.(*persistConn).writeLoop(0xc00015aa20) /usr/local/opt/go/libexec/src/net/http/transport.go:2386 +0x1a9 created by net/http.(*Transport).dialConn /usr/local/opt/go/libexec/src/net/http/transport.go:1748 +0x2f8b ] --- FAIL: TestR (1.47s)
Hi,
Running uber-go/goleak, I found that this example
Run go test ./internal/ -race -v -count=1
Code Snippet
Exception/Log
Technical details: