Skip to content

Commit

Permalink
Test stability
Browse files Browse the repository at this point in the history
- Instead of artificially moving a connection state to disconnected, forcibly close the transport connection
- Increase timers to reduce race conditions in test with artificially low retry timeouts
  • Loading branch information
mattheworiordan committed Nov 26, 2015
1 parent a295460 commit d074df6
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions spec/acceptance/realtime/connection_spec.rb
Expand Up @@ -445,7 +445,16 @@ def expect_ordered_phases
been_disconnected = true
end
connection.once(:connecting) do
connection.transition_state_machine :disconnected
close_if_transport_available = proc do
EventMachine.add_timer(0.001) do
if connection.transport
connection.transport.close_connection_after_writing
else
close_if_transport_available.call
end
end
end
close_if_transport_available.call
end

connection.connect do
Expand Down Expand Up @@ -1163,7 +1172,7 @@ def self.available_states
let(:client_options) do
default_options.merge(
log_level: :fatal,
disconnected_retry_timeout: 0.01,
disconnected_retry_timeout: 0.02,
suspended_retry_timeout: 60,
connection_state_ttl: 0.05
)
Expand Down

0 comments on commit d074df6

Please sign in to comment.