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 flaky OTLP exporter reconnect test #1814

Merged
merged 4 commits into from
Apr 15, 2021
Merged

Conversation

MrAlias
Copy link
Contributor

@MrAlias MrAlias commented Apr 14, 2021

The tests that check the OTLP exporter will reconnect wait for the reconnect loop to complete, in theory. However, they do not yield the active goroutine scheduling. The reconnect loop is in its own goroutine meaning it is unlikely for that loop to be re-entered, especially on slow systems. This updates the tests call runtime.Gosched when waiting for the reconnect loop and yield the scheduling to other goroutines.

This does not clean up the duplicate testing (TestNewExporter_collectorConnectionDiesThenReconnectsWhenInRestMode seems to be a paired down version of TestNewExporter_collectorConnectionDiesThenReconnects), which I'm planning to address in a follow up PR. Because of this, the reuse of the "wait" function is just duplicated instead of abstracted into its own declaration.

Related to #1527

The tests that check the OTLP exporter will reconnect wait for the
reconnect loop to complete, in theory. However, they do not yield the
active goroutine scheduling. The reconnect loop is in its own goroutine
meaning it is unlikely for that loop to be re-entered, especially on
slow systems. This updates the tests call runtime.Gosched when waiting
for the reconnect loop and yield the scheduling to other goroutines.
@MrAlias MrAlias added bug Something isn't working pkg:exporter:otlp Related to the OTLP exporter package labels Apr 14, 2021
@codecov
Copy link

codecov bot commented Apr 14, 2021

Codecov Report

Merging #1814 (7cb51a1) into main (b09df84) will decrease coverage by 0.0%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #1814     +/-   ##
=======================================
- Coverage   78.6%   78.6%   -0.1%     
=======================================
  Files        134     134             
  Lines       7158    7158             
=======================================
- Hits        5632    5630      -2     
- Misses      1276    1278      +2     
  Partials     250     250             
Impacted Files Coverage Δ
exporters/otlp/otlpgrpc/connection.go 88.7% <0.0%> (-1.9%) ⬇️

@MrAlias
Copy link
Contributor Author

MrAlias commented Apr 14, 2021

This looks like it has not completely resolved this issue: https://github.com/open-telemetry/opentelemetry-go/pull/1814/checks?check_run_id=2346462483

I think it is a step forward and should be merged still, but will remove the linked issue as being resolved.

@MrAlias MrAlias added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Apr 14, 2021
@MrAlias MrAlias merged commit d616df6 into open-telemetry:main Apr 15, 2021
@MrAlias MrAlias deleted the fix-1527 branch April 15, 2021 01:53
@MrAlias MrAlias mentioned this pull request Apr 23, 2021
@pellared pellared added this to the untracked milestone Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg:exporter:otlp Related to the OTLP exporter package Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants