You've already forked opentelemetry-go
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user