Stabilize test server boot on macOS#261
Merged
felipedmesquita merged 1 commit intotyphoeus:masterfrom Aug 25, 2025
Merged
Conversation
Ensure the spec helper's WEBrick server starts and is detected reliably on recent macOS: - Bind WEBrick explicitly to `localhost` and probe readiness via `127.0.0.1` to avoid IPv6/IPv4 `localhost` resolution mismatches that triggered Net::OpenTimeout during boot. (Copilot) - Use a single Rackup/Rack WEBrick handler constant consistently - Keep WEBrick for tests since it supports custom methods (e.g. `PURGE`) that stricter servers reject. - Trap INT and call handler.shutdown via the shared constant to cleanly stop the server process, helping prevent orphaned servers and file descriptor leaks (seen as `Errno::EMFILE` after reruns). - Replace deprecated top-level `TimeoutError` with `Timeout::Error` and require `timeout` With these changes, the test server comes up promptly and the suite no longer times out on Apple Silicon/macOS, and repeated runs don't exhaust file descriptors. Fix typhoeus#260
Contributor
Author
|
This is co-authored by Copilot, actually it did find the issue with IPv4 IPv6 which was preventing the server to work on macos Failures are unrelated (segfault) |
Member
|
Thanks, @tagliala! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Ensure the spec helper's WEBrick server starts and is detected reliably on recent macOS:
localhostand probe readiness via127.0.0.1to avoid IPv6/IPv4localhostresolution mismatches that triggered Net::OpenTimeout during boot. (Copilot)PURGE) that stricter servers reject.Errno::EMFILEafter reruns).TimeoutErrorwithTimeout::Errorand requiretimeoutWith these changes, the test server comes up promptly and the suite no longer times out on Apple Silicon/macOS, and repeated runs don't exhaust file descriptors.
Fix #260