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

Fix exporter unittest occasional error #4

Closed
wants to merge 1 commit into from

Conversation

Petrie
Copy link
Owner

@Petrie Petrie commented Jul 3, 2022

A few days ago, I open a pr open-telemetry#2987 , try fix golangci-lint not working correctly. But the pr checks occur a error in unittest TestExporterShutdown/testClientStopHonorsTimeout for exporter grpc client Stop() function :exporters/otlp/otlptrace/otlptracegrpc/client.go#L130

I figure out in Stop(ctx context.Context) the select for <-ctx.Done() and acquired may reach at the same time. In select if acquired be exec first, The Stop(ctx context.Context) function may return nil . when Stop(ctx context.Context) function return nil, unittest TestExporterShutdown/testClientStopHonorsTimeout and TestExporterShutdown/testClientStopHonorsTimeout will failure.

This is a occasional error. you can recurrent it by this shell.

cd exporters/otlp/otlptrace/otlptracegrpc/
while true ; do go clean -testcache | go list \
| xargs go test -v -timeout 60s -race -run \
  TestExporterShutdown/testClientStopHonorsTimeout; sleep 0.5;  done;

@Petrie Petrie force-pushed the exporter-unit-test-occasional-err branch from ff2fdbe to fe6320a Compare July 3, 2022 16:16
@Petrie Petrie closed this Jul 4, 2022
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

Successfully merging this pull request may close these issues.

1 participant