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

MockCollector test bug #1002

Closed
isaachier opened this issue Aug 17, 2018 · 3 comments
Closed

MockCollector test bug #1002

isaachier opened this issue Aug 17, 2018 · 3 comments

Comments

@isaachier
Copy link
Contributor

Requirement - what kind of business use case are you trying to solve?

On my desktop (Arch Linux/Manjaro), I consistently get the following test error:

Error Trace:	mock_collector_test.go:162
			Error:      	An error is expected but got nil.
			Test:       	TestMockTCollectorErrors
			Messages:   	error because of bad address

Problem - what in Jaeger blocks you from solving the requirement?

The test expects binding to 127.0.0 to fail. After some digging with strace I discovered that somehow the system extends the supposedly broken address of 127.0.0 to be 127.0.0.0. Then, strace shows this:
bind(3, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("127.0.0.0")}, 16) = 0.

Proposal - what do you suggest to solve the problem or improve the existing situation?

Remove the assertion that requires this bind to fail seeing as it is not portable/correct.

Any open questions to address

Find out why this is OK in Travis but not my version of Go (1.10.3) and Linux (Linux 4.18.0-1-MANJARO #1 SMP PREEMPT x86_64 GNU/Linux).

@yurishkuro
Copy link
Member

yurishkuro commented Aug 17, 2018

maybe we should bind to a different address that is more likely to be invalid. The reason the assertion is there is to have code coverage of the error handling.

@isaachier
Copy link
Contributor Author

Good idea. An easy choice would be an overflow value like "256.0.0.0" instead.

@isaachier
Copy link
Contributor Author

isaachier commented Aug 17, 2018

Update:

Related failures.

--- FAIL: TestNewZipkinThriftUDPClient (0.00s)
	assertions.go:256: 
			Error Trace:	thriftudp_client_test.go:27
			Error:      	An error is expected but got nil.
			Test:       	TestNewZipkinThriftUDPClient
=== RUN   TestNewJaegerThriftUDPClient
--- FAIL: TestNewJaegerThriftUDPClient (0.00s)
	assertions.go:256: 
			Error Trace:	thriftudp_client_test.go:38
			Error:      	An error is expected but got nil.
			Test:       	TestNewJaegerThriftUDPClient
FAIL
FAIL	github.com/jaegertracing/jaeger/cmd/agent/app/testutils	0.104s

They rely on 1.2.3 being a bad address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants