Skip to content

Commit 8e2b944

Browse files
justin808claude
andcommitted
Respect user-configured readiness timeout and simplify URI handling
- Remove timeout cap that prevented honoring user-specified timeouts - Previously capped at 2 seconds with [config.server_readiness_timeout || 5, 2].min - Now respects full configured timeout value (default: 5 seconds) - Remove redundant uri.path.empty? check since readiness_path defaults to '/' This allows users to configure longer timeouts for slow environments while maintaining clean, simple code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 5a1867d commit 8e2b944

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/cypress_on_rails/server.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,11 @@ def wait_for_server(timeout = 30)
135135
def server_responding?
136136
config = CypressOnRails.configuration
137137
readiness_path = config.server_readiness_path || '/'
138-
# Use shorter timeout for individual readiness checks since we poll in a loop
139-
# The configured timeout is for slow CI, but each check should be quick
140-
timeout = [config.server_readiness_timeout || 5, 2].min
138+
timeout = config.server_readiness_timeout || 5
141139
uri = URI("http://#{host}:#{port}#{readiness_path}")
142140

143141
response = Net::HTTP.start(uri.host, uri.port, open_timeout: timeout, read_timeout: timeout) do |http|
144-
# Ensure path is never empty - default to '/'
145-
http.get(uri.path.empty? ? '/' : uri.path)
142+
http.get(uri.path)
146143
end
147144

148145
# Accept 200-399 (success and redirects), reject 404 and 5xx

0 commit comments

Comments
 (0)