open-telemetry / opentelemetry-go

OpenTelemetry Go API and SDK
https://opentelemetry.io/docs/languages/go
Apache License 2.0
5.3k stars 1.08k forks source link

zipkin TestExporterSpans fail #693

Closed tensorchen closed 4 years ago

tensorchen commented 4 years ago

run make precommit

go test ./... + race in ./exporters/trace/zipkin
=== RUN   TestExportSpans
--- FAIL: TestExportSpans (3.02s)
    exporter_test.go:126: about to send a POST request to http://[::]:52481 with body [{"timestamp":1583954640000000,"duration":60000000,"traceId":"000102030405060708090a0b0c0d0e0f","id":"fffefdfcfbfaf9f8","name":"foo","kind":"SERVER","localEndpoint":{"serviceName":"exporter-test"},"tags":{"ot.status_code":"NotFound","ot.status_description":"404, file not found"}}]
    exporter_test.go:126: zipkin responded with status 502
    exporter_test.go:126: no spans to export
    exporter_test.go:126: about to send a POST request to http://[::]:52481 with body [{"timestamp":1583954655000000,"duration":30000000,"traceId":"000102030405060708090a0b0c0d0e0f","id":"dfdedddcdbdad9d8","parentId":"fffefdfcfbfaf9f8","name":"bar","kind":"SERVER","localEndpoint":{"serviceName":"exporter-test"},"tags":{"ot.status_code":"PermissionDenied","ot.status_description":"403, forbidden"}}]
    exporter_test.go:126: zipkin responded with status 502
    require.go:278: 
                Error Trace:    exporter_test.go:255
                Error:          Condition never satisfied
                Test:           TestExportSpans
=== RUN   TestModelConversion
--- PASS: TestModelConversion (0.00s)
FAIL
FAIL    go.opentelemetry.io/otel/exporters/trace/zipkin 3.328s
FAIL
tensorchen commented 4 years ago

In startMockZipkinCollector function, If I change net.Listen("tcp", ":0") to net.Listen("tcp", "127.0.0.1:0") or net.Listen("tcp", "[::1]:0"), it works normally.

Aneurysm9 commented 4 years ago

I'm not able to reproduce on WSL Ubuntu 18.04 and the CircleCI tests have not reproduced this. Can you provide any information about your configuration that might be different? A 502 response indicates that something is intercepting the request, perhaps an anti-virus system with a "transparent" HTTP proxy?

tensorchen commented 4 years ago

@Aneurysm9 Yes, there is an HTTP proxy in my environment. Every time before make precommit, I need unset http_proxy