Fix BatchSpanProcessor context done tests #1863
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#1860 added support for the BatchSpanProcessor to return export failures. This was added using a select statement.
opentelemetry-go/sdk/trace/batch_span_processor.go
Lines 165 to 169 in e399d35
In Go select statements are random when multiple cases can be satisfied. This means that if the exporter is shutdown fast enough and the context has ended there is a chance that the exporter error value will be returned instead of the context error, causing test failures.
This updates the tests to have the exporter return the same context error, which a valid exporter should be doing, and resolves the bug.