pingcap / pingcap/tiproxy

TestNetworkError sometimes fails

Open
#534 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

unit test
Dominant language
Go
Stars
73
Forks
41
Avg merge
21h 3m
Merged PRs (30d)
21

Description

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

make test on 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:54:55 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T8122 arm64

2. What did you expect to see? (Required)

All tests pass

3. What did you see instead (Required)

Sometimes TestNetworkError fails:

--- FAIL: TestNetworkError (0.01s)
    common_test.go:113: client quit, error: <nil>
    common_test.go:134: proxy quit, error: this is an error from the client connection: failed to read the connection: EOF
        github.com/pingcap/tiproxy/pkg/proxy/net.(*basicReadWriter).Read
        	/Users/zhangming/gopath/src/github.com/pingcap/tiproxy/pkg/proxy/net/packetio.go
        github.com/pingcap/tiproxy/pkg/proxy/net.ReadFull
        	/Users/zhangming/gopath/src/github.com/pingcap/tiproxy/pkg/proxy/net/packetio.go
        github.com/pingcap/tiproxy/pkg/proxy/net.(*PacketIO).readOnePacket
        	/Users/zhangming/gopath/src/github.com/pingcap/tiproxy/pkg/proxy/net/packetio.go
        github.com/pingcap/tiproxy/pkg/proxy/net.(*PacketIO).ReadPacket
        	/Users/zhangming/gopath/src/github.com/pingcap/tiproxy/pkg/proxy/net/packetio.go
        github.com/pingcap/tiproxy/pkg/proxy/net.(*PacketIO).ReadSSLRequestOrHandshakeResp
        	/Users/zhangming/gopath/src/github.com/pingcap/tiproxy/pkg/proxy/net/packetio_mysql.go
        github.com/pingcap/tiproxy/pkg/proxy/backend.(*Authenticator).handshakeFirstTime
        	/Users/zhangming/gopath/src/github.com/pingcap/tiproxy/pkg/proxy/backend/authenticator.go
        github.com/pingcap/tiproxy/pkg/proxy/backend.(*mockProxy).authenticateFirstTime
        	/Users/zhangming/gopath/src/github.com/pingcap/tiproxy/pkg/proxy/backend/mock_proxy_test.go
        github.com/pingcap/tiproxy/pkg/proxy/backend.(*tcpConnSuite).run.func3
        	/Users/zhangming/gopath/src/github.com/pingcap/tiproxy/pkg/proxy/backend/common_test.go
        github.com/pingcap/tiproxy/lib/util/waitgroup.(*WaitGroup).Run.func1
        	/Users/zhangming/gopath/src/github.com/pingcap/tiproxy/lib/util/waitgroup/waitgroup.go
        runtime.goexit
        	/opt/homebrew/Cellar/go/1.22.2/libexec/src/runtime/asm_arm64.s
    common_test.go:122: backend quit, error: <nil>
    cmd_processor_test.go:1036:
        	Error Trace:	/Users/zhangming/gopath/src/github.com/pingcap/tiproxy/pkg/proxy/backend/cmd_processor_test.go:1036
        	            				/Users/zhangming/gopath/src/github.com/pingcap/tiproxy/pkg/proxy/backend/testsuite_test.go:175
        	            				/Users/zhangming/gopath/src/github.com/pingcap/tiproxy/pkg/proxy/backend/testsuite_test.go:181
        	            				/Users/zhangming/gopath/src/github.com/pingcap/tiproxy/pkg/proxy/backend/cmd_processor_test.go:1043
        	Error:      	Should be true
        	Test:       	TestNetworkError
FAIL
4. What is your version? (Required)

master

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run make test and focus on TestNetworkError in pkg/proxy/backend/common_test.go. Read the failure path through cmd_processor_test.go, testsuite_test.go, and the referenced packet I/O files. Done means the intermittent test failure is understood and TestNetworkError passes reliably.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
networking, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.