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

Eliminate external HTTP requests on test #2253

Merged
merged 3 commits into from
Jan 24, 2025
Merged

Eliminate external HTTP requests on test #2253

merged 3 commits into from
Jan 24, 2025

Conversation

ksss
Copy link
Collaborator

@ksss ksss commented Jan 22, 2025

This is a fix for a problem where the net/http test was failing.
Fixed to eliminate dependence on external site behavior and complete only on the local network.

assert_send_type "(URI::Generic) -> nil",
Net::HTTP, :get_print, uri
assert_send_type "(String, String) -> nil",
Net::HTTP, :get_print, "www.ruby-lang.org", "/en"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some lines look like they still connect to ruby-lang.org. Is this intentional?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was testing while disconnecting the PC from the network, but it seems the error was being suppressed in the rescue block.

@soutaro
Copy link
Member

soutaro commented Jan 24, 2025

@ksss This is really great improvement! 👏 👏 👏

@soutaro soutaro added this to the RBS 3.9 milestone Jan 24, 2025
And remove rescure
@ksss
Copy link
Collaborator Author

ksss commented Jan 24, 2025

I removed the rescue block and ran Net_HTTP_test.rb 500 times locally, and all executions were successful.

@soutaro soutaro added this pull request to the merge queue Jan 24, 2025
Merged via the queue into ruby:master with commit c04a6b0 Jan 24, 2025
1 check passed
github-merge-queue bot pushed a commit that referenced this pull request Jan 24, 2025
Eliminate external HTTP requests on test
@ksss ksss deleted the net-http branch January 24, 2025 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants