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

test: Make Net::HTTP Deterministic #1390

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

arielvalentin
Copy link
Collaborator

We would occasionally get errors where the test would attempt to make actual HTTP calls to example.com because dedpending on the order the tests would run WebMock would be configured to allow network calls.

OpenTelemetry::Instrumentation::Net::HTTP::Instrumentation::untraced?::untraced context#test_0002_no-ops on #connect:
Net::OpenTimeout: Failed to open TCP connection to example.com:80 (execution expired)

https://github.com/open-telemetry/opentelemetry-ruby-contrib/actions/runs/13089176560/job/36523848687?pr=1388

This change ensures that WebMock is reset between test cases and raise an error when unexpected network requests occur.

We would occasionally get errors where the test would attempt to make actual HTTP calls to example.com
because dedpending on the order the tests would run WebMock would be configured to allow network calls.

> OpenTelemetry::Instrumentation::Net::HTTP::Instrumentation::untraced?::untraced context#test_0002_no-ops on #connect:
> Net::OpenTimeout: Failed to open TCP connection to example.com:80 (execution expired)

https://github.com/open-telemetry/opentelemetry-ruby-contrib/actions/runs/13089176560/job/36523848687?pr=1388

This change ensures that WebMock is reset between test cases and raise an error when unexpected network requests occur.
@arielvalentin
Copy link
Collaborator Author

The irony.

image

@arielvalentin arielvalentin self-assigned this Feb 3, 2025
@arielvalentin arielvalentin marked this pull request as draft February 3, 2025 13:30
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