1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-11-27 22:49:15 +02:00

Fix flaky test TestSimpleSpanProcessorShutdownHonorsContextCancel (#2290)

* Fix flaky test TestSimpleSpanProcessorShutdownHonorsContextCancel

* Add changes to changelog

* Prioritize return of exporter error

* Update changelog description

* Fix deadlock bug
This commit is contained in:
Tyler Yahn
2021-10-19 08:13:37 -07:00
committed by GitHub
parent 1f4b606be8
commit 23a33739e9
3 changed files with 24 additions and 3 deletions

View File

@@ -40,9 +40,15 @@ func (t *testExporter) ExportSpans(ctx context.Context, spans []sdktrace.ReadOnl
return nil
}
func (t *testExporter) Shutdown(context.Context) error {
func (t *testExporter) Shutdown(ctx context.Context) error {
t.shutdown = true
return nil
select {
case <-ctx.Done():
// Ensure context deadline tests receive the expected error.
return ctx.Err()
default:
return nil
}
}
var _ sdktrace.SpanExporter = (*testExporter)(nil)