Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Description

@anthonyfok

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:

  • It is not limited to ppc64le (ppc64el); I was able to reproduce the same errors on my amd64 computer.
  • It is found in both v1.1.0 and v1.3.4 (master as of this writing)
  • It happens randomly, and I need to run loops like below to trigger the errors:
$ 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions