aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/test/connection
diff options
context:
space:
mode:
authorTinco Andringa <mail@tinco.nl>2016-07-01 00:42:51 +0200
committerTinco Andringa <mail@tinco.nl>2016-07-01 23:03:30 +0200
commit3120b51de7d391d04eae5332b91c753d0643cbd4 (patch)
tree15a1d2fe4d11a6df14c5763b15331ea0530cd621 /actioncable/test/connection
parentb036b7a8106e4362f909401cc5a26c92887d2852 (diff)
downloadrails-3120b51de7d391d04eae5332b91c753d0643cbd4.tar.gz
rails-3120b51de7d391d04eae5332b91c753d0643cbd4.tar.bz2
rails-3120b51de7d391d04eae5332b91c753d0643cbd4.zip
close hijacked i/o socket after use (fixes #25613)
Diffstat (limited to 'actioncable/test/connection')
-rw-r--r--actioncable/test/connection/client_socket_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/actioncable/test/connection/client_socket_test.rb b/actioncable/test/connection/client_socket_test.rb
index 4af071b4da..fe9077ae7f 100644
--- a/actioncable/test/connection/client_socket_test.rb
+++ b/actioncable/test/connection/client_socket_test.rb
@@ -48,6 +48,20 @@ class ActionCable::Connection::ClientSocketTest < ActionCable::TestCase
end
end
+ test 'closes hijacked i/o socket at shutdown' do
+ skip if ENV['FAYE'].present?
+
+ run_in_eventmachine do
+ connection = open_connection
+
+ client = connection.websocket.send(:websocket)
+ client.instance_variable_get('@stream')
+ .instance_variable_get('@rack_hijack_io')
+ .expects(:close)
+ connection.close
+ end
+ end
+
private
def open_connection
env = Rack::MockRequest.env_for '/test',