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: TestTCPServer/tcp4_:0<-127.0.0.1 failures on Windows with EOF (and no other output) #52926

Open
bcmills opened this issue May 16, 2022 · 1 comment
Labels
help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Windows
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented May 16, 2022

--- FAIL: TestTCPServer (0.02s)
    --- FAIL: TestTCPServer/tcp4_:0<-127.0.0.1 (0.00s)
        server_test.go:113: #19: EOF
FAIL
FAIL	net	54.788s

greplogs -l -e 'FAIL: TestTCPServer .*(?:\n[ ]+.*)* EOF'
2022-05-13T21:00:31-e755a56/windows-amd64-longtest
2019-11-07T02:33:31-198f045/windows-amd64-longtest

Probably a good first step would be to update this test to log more information about what's going on (per https://go.dev/wiki/CodeReviewComments#useful-test-failures), although given the low rate of occurrence it may be a while before we get another hit. 😅

(CC @ianlancetaylor @neild @golang/windows)

@bcmills bcmills added help wanted OS-Windows NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels May 16, 2022
@bcmills bcmills added this to the Backlog milestone May 16, 2022
@ZekeLu
Copy link
Contributor

ZekeLu commented May 17, 2022

I have tried to modify transceiver() to write hard-coded error into the channel. According to my test, the EOF error can only appear on line 308 and send to the channel on line 313. It seems that there is not more information can be added to the test to help diagnose this issue.

func transceiver(c Conn, wb []byte, ch chan<- error) {
defer close(ch)
c.SetDeadline(time.Now().Add(someTimeout))
c.SetReadDeadline(time.Now().Add(someTimeout))
c.SetWriteDeadline(time.Now().Add(someTimeout))
n, err := c.Write(wb)
if err != nil {
if perr := parseWriteError(err); perr != nil {
ch <- perr
}
ch <- err
return
}
if n != len(wb) {
ch <- fmt.Errorf("wrote %d; want %d", n, len(wb))
}
rb := make([]byte, len(wb))
n, err = c.Read(rb)
if err != nil {
if perr := parseReadError(err); perr != nil {
ch <- perr
}
ch <- err
return
}
if n != len(wb) {
ch <- fmt.Errorf("read %d; want %d", n, len(wb))
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Windows
Projects
None yet
Development

No branches or pull requests

2 participants