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

Odd test failure in otel-collector #2239

Closed
yurishkuro opened this issue May 11, 2020 · 5 comments · Fixed by #2243
Closed

Odd test failure in otel-collector #2239

yurishkuro opened this issue May 11, 2020 · 5 comments · Fixed by #2243

Comments

@yurishkuro
Copy link
Member

$ make test
skipping go generate ./...
cd ./cmd/opentelemetry-collector && bash -c "set -e; set -o pipefail; go test -v -race ./... | sed ''/PASS/s//PASS/'' | sed ''/FAIL/s//FAIL/''"

...

ok  	github.com/jaegertracing/jaeger/cmd/opentelemetry-collector/app/exporter/cassandra	2.989s
=== RUN   TestDefaultConfig
--- PASS: TestDefaultConfig (0.02s)
=== RUN   TestLoadConfigAndFlags
--- PASS: TestLoadConfigAndFlags (0.03s)
=== RUN   TestCreateTraceExporter
    TestCreateTraceExporter: factory_test.go:41:
        	Error Trace:	factory_test.go:41
        	Error:      	Error message not equal:
        	            	expected: "failed to create primary Elasticsearch client: health check timeout: Head http://127.0.0.1:9200: dial tcp 127.0.0.1:9200: connect: connection refused: no Elasticsearch node available"
        	            	actual  : "failed to create primary Elasticsearch client: health check timeout: Head \"http://127.0.0.1:9200\": dial tcp 127.0.0.1:9200: connect: connection refused: no Elasticsearch node available"
        	Test:       	TestCreateTraceExporter
--- FAIL: TestCreateTraceExporter (5.03s)
=== RUN   TestCreateTraceExporter_nilConfig
--- PASS: TestCreateTraceExporter_nilConfig (0.00s)
=== RUN   TestCreateMetricsExporter
--- PASS: TestCreateMetricsExporter (0.00s)
=== RUN   TestCreateDefaultConfig
--- PASS: TestCreateDefaultConfig (0.00s)
=== RUN   TestType
--- PASS: TestType (0.00s)
FAIL
FAIL	github.com/jaegertracing/jaeger/cmd/opentelemetry-collector/app/exporter/elasticsearch	8.397s

cc @pavolloffay

@pavolloffay
Copy link
Member

I wasn't able to reproduce it locally. The expected and actual strings almost match except the double quotes for the URL. I am not sure why it happened.

seq 20 | xargs -I -- go test -count=1 -v -race ./app/exporter/elasticsearch...

@yurishkuro
Copy link
Member Author

I can reproduce. Which Go are you using? I have

$ go version
go version go1.14.2 darwin/amd64

@yurishkuro
Copy link
Member Author

in any case, I prefer to avoid tests that check for the exact full error string, and instead only check for certain key phrases using assert.Contains.

@pavolloffay
Copy link
Member

With go1.13.4.linux-amd64 it is passing fine with go1.14.2.linux-amd64 it is failing on the same statement.

@pavolloffay
Copy link
Member

This is a change in go 1.14 golang/go#37614 and https://golang.org/doc/go1.14#net/url. It's not well described as it says that the URL is quoted when it cannot be parsed, but it's quoted then the request fails.

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

Successfully merging a pull request may close this issue.

2 participants