xtaci / smux

A Stream Multiplexing Library for golang with least memory usage(TDMA)
MIT License
1.27k stars 189 forks source link

Flaky tests (panic: Fail in goroutine) in v1.3.4 discovered by Ubuntu autopkgtest #54

Closed anthonyfok closed 4 years ago

anthonyfok commented 4 years ago

Ubuntu autopkgtest of the latest github.com/xtaci/smux v1.3.4 (Debian package golang-github-xtaci-smux/1.3.4+ds-1) fails Ubuntu autopkgtest on ppc64el:

(Special thanks to @LocutusOfBorg for telling me about this issue over IRC on #ubuntu-devel as this apparent test regression is preventing golang-github-xtaci-smux's migration to Eoan, i.e. Ubuntu 19.10.)

Further tests reveal that:

$ while go test -vet=off -p 1 github.com/xtaci/smux; do go clean -testcache; done
ok      github.com/xtaci/smux   8.712s
ok      github.com/xtaci/smux   8.677s
ok      github.com/xtaci/smux   9.041s
ok      github.com/xtaci/smux   8.803s
ok      github.com/xtaci/smux   8.756s
ok      github.com/xtaci/smux   8.800s
ok      github.com/xtaci/smux   8.742s
ok      github.com/xtaci/smux   8.719s
--- FAIL: TestIsClose (0.00s)
    session_test.go:36: accept tcp 127.0.0.1:44465: use of closed network connection
FAIL
FAIL    github.com/xtaci/smux   8.796s

Another run:

$ while go test -vet=off -p 4 github.com/xtaci/smux; do go clean -testcache; done
ok      github.com/xtaci/smux   8.734s
ok      github.com/xtaci/smux   8.719s
ok      github.com/xtaci/smux   8.691s
ok      github.com/xtaci/smux   8.705s
ok      github.com/xtaci/smux   9.074s
ok      github.com/xtaci/smux   9.369s
panic: Fail in goroutine after TestSessionDoubleClose has completed

goroutine 2106 [running]:
testing.(*common).Fail(0xc000d66100)
    /usr/lib/go-1.12/src/testing/testing.go:565 +0x11e
testing.(*common).Error(0xc000d66100, 0xc000090660, 0x1, 0x1)
    /usr/lib/go-1.12/src/testing/testing.go:654 +0x79
github.com/xtaci/smux.setupServer.func1(0x8e3a20, 0xc000010058, 0x8e99e0, 0xc000d66100)
    /home/foka/go/src/github.com/xtaci/smux/session_test.go:36 +0xbc
created by github.com/xtaci/smux.setupServer
    /home/foka/go/src/github.com/xtaci/smux/session_test.go:33 +0xf9
FAIL    github.com/xtaci/smux   1.814s

and also:

panic: Fail in goroutine after TestCloseThenOpen has completed

goroutine 1430 [running]:
testing.(*common).Fail(0xc000184100)
    /usr/lib/go-1.12/src/testing/testing.go:565 +0x12c
testing.(*common).Error(0xc000184100, 0xc0001100d0, 0x1, 0x1)
    /usr/lib/go-1.12/src/testing/testing.go:654 +0x70
github.com/xtaci/smux.setupServer.func1(0x104af340, 0xc0000a8068, 0x104b52c0, 0xc000184100)
    /home/foka/go/src/github.com/xtaci/smux/session_test.go:36 +0xbc
created by github.com/xtaci/smux.setupServer
    /home/foka/go/src/github.com/xtaci/smux/session_test.go:33 +0xd0
FAIL    github.com/xtaci/smux   2.360s

Thanks for looking into the issue.

/cc @rogers0

xtaci commented 4 years ago

it's due to incorrect reporting of test error.

xtaci commented 4 years ago

https://github.com/xtaci/smux/releases/tag/v1.3.5

anthonyfok commented 4 years ago

Thank you so much for your prompt resolution to this issue!

xtaci commented 4 years ago

if there are more errors, feel free to open issues .