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

Intermittent unit test failure for sidecar DNS #443

Open
zcahana opened this issue Dec 12, 2016 · 0 comments
Open

Intermittent unit test failure for sidecar DNS #443

zcahana opened this issue Dec 12, 2016 · 0 comments

Comments

@zcahana
Copy link
Member

zcahana commented Dec 12, 2016

There's a unit test for the sidecar DNS function that intermittently fails (with a panic), thus failing the Travis build. The failure does seems to be related to a code bug, but rather to a test bug where several unit tests are attempting to bind a DNS server to the same server port:
A potential solution can be to allocate sequential, exclusive ports to each unit tests.

Example failure (source):

=== RUN   TestRequestsSRVWithTag
time="2016-12-12T09:55:30Z" level=info msg="Starting DNS server" 
time="2016-12-12T09:55:30Z" level=error msg="Error starting DNS server" error="listen udp :8823: bind: address already in use" 
time="2016-12-12T09:55:32Z" level=info msg="Shutting down DNS server" 
time="2016-12-12T09:55:32Z" level=error msg="Error shutting down DNS server" error="dns: server not started" 
--- FAIL: TestRequestsSRVWithTag (2.20s)
	Error Trace:	server_test.go:207
	Error:		Received unexpected error read udp 127.0.0.1:53017->127.0.0.1:8823: i/o timeout
		
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x488c2f]
goroutine 11 [running]:
panic(0x777100, 0xc4200121b0)
	/home/travis/.gimme/versions/go1.7.1.linux.amd64/src/runtime/panic.go:500 +0x1a1
testing.tRunner.func1(0xc420082600)
	/home/travis/.gimme/versions/go1.7.1.linux.amd64/src/testing/testing.go:579 +0x25d
panic(0x777100, 0xc4200121b0)
	/home/travis/.gimme/versions/go1.7.1.linux.amd64/src/runtime/panic.go:458 +0x243
github.com/amalgam8/amalgam8/sidecar/dns.(*TestSuite).TestRequestsSRVWithTag(0xc42001aa50)
	/home/travis/gopath/src/github.com/amalgam8/amalgam8/sidecar/dns/server_test.go:208 +0x12f
reflect.Value.call(0xc4201f7200, 0xc4200325a8, 0x13, 0x7d1e26, 0x4, 0xc420053f40, 0x1, 0x1, 0x5d3a48, 0x7ceee0, ...)
	/home/travis/.gimme/versions/go1.7.1.linux.amd64/src/reflect/value.go:434 +0x5c8
reflect.Value.Call(0xc4201f7200, 0xc4200325a8, 0x13, 0xc420053f40, 0x1, 0x1, 0xc4203b6400, 0x8b0, 0x8c)
	/home/travis/.gimme/versions/go1.7.1.linux.amd64/src/reflect/value.go:302 +0xa4
github.com/amalgam8/amalgam8/vendor/github.com/stretchr/testify/suite.Run.func2(0xc420082600)
	/home/travis/gopath/src/github.com/amalgam8/amalgam8/vendor/github.com/stretchr/testify/suite/suite.go:95 +0x1cb
testing.tRunner(0xc420082600, 0xc420297c70)
	/home/travis/.gimme/versions/go1.7.1.linux.amd64/src/testing/testing.go:610 +0x81
created by testing.(*T).Run
	/home/travis/.gimme/versions/go1.7.1.linux.amd64/src/testing/testing.go:646 +0x2ec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant