Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Adding 'connect' timeout option for wire service to override the default of 3 seconds. #234

Merged
merged 3 commits into from

2 participants

@mwatkins

This request addresses adding a 'connect' timeout option that will allow users to specify a default timeout for the time it takes to establish a connection with the wire service. We were running into timeouts when running tests concurrently in conjunction with Cuke4PHP. Increasing this timeout made these errors go away.

@mattwynne mattwynne referenced this pull request from a commit
@mattwynne mattwynne Fix failing spec #234 4eb56cc
@mattwynne mattwynne merged commit 1cd2183 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
1  lib/cucumber/wire_support/configuration.rb
@@ -21,6 +21,7 @@ def timeout(message = nil)
def default_timeouts
{
+ 'connect' => 10,
'invoke' => 120,
'begin_scenario' => 120,
'end_scenario' => 120
View
2  lib/cucumber/wire_support/connection.rb
@@ -32,7 +32,7 @@ def exception(params)
private
def send_data_to_socket(data)
- Timeout.timeout(@config.timeout) { socket.puts(data) }
+ Timeout.timeout(@config.timeout('connect')) { socket.puts(data) }
end
def fetch_data_from_socket(timeout)
View
12 spec/cucumber/wire_support/configuration_spec.rb
@@ -31,7 +31,17 @@ def write_wire_file(contents)
}
config.timeout('invoke').should == 99
end
-
+
+ it "reads the timeout for a connect message" do
+ write_wire_file %q{
+ host: localhost
+ port: 54321
+ timeout:
+ connect: 99
+ }
+ config.timeout('connect').should == 99
+ end
+
describe "a wire file with no timeouts specified" do
before(:each) do
write_wire_file %q{
Something went wrong with that request. Please try again.