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

Make connect_timeout work with DNS resolution #3337

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/webpacker/dev_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def initialize(config)

def running?
if config.dev_server.present?
Socket.tcp(host, port, connect_timeout: connect_timeout).close
Timeout.timeout(connect_timeout) { Socket.tcp(host, port).close }
true
else
false
Expand Down
1 change: 1 addition & 0 deletions lib/webpacker/dev_server_runner.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require "shellwords"
require "socket"
require "timeout"
require "webpacker/configuration"
require "webpacker/dev_server"
require "webpacker/runner"
Expand Down
1 change: 1 addition & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require "rails"
require "rails/test_help"
require "byebug"
require "ostruct"
Copy link
Author

Choose a reason for hiding this comment

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

Without this tests were failing with

Error:
CompilerTest#test_freshness_on_compile_success:
NameError: uninitialized constant CompilerTest::OpenStruct

e.g. on https://github.com/rails/webpacker/actions/runs/9956692322/job/27507151674#step:4:83


require_relative "test_app/config/environment"

Expand Down
Loading