diff options
author | Tinco Andringa <mail@tinco.nl> | 2016-07-01 00:42:51 +0200 |
---|---|---|
committer | Tinco Andringa <mail@tinco.nl> | 2016-07-01 23:03:30 +0200 |
commit | 3120b51de7d391d04eae5332b91c753d0643cbd4 (patch) | |
tree | 15a1d2fe4d11a6df14c5763b15331ea0530cd621 /actioncable/test/connection | |
parent | b036b7a8106e4362f909401cc5a26c92887d2852 (diff) | |
download | rails-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.rb | 14 |
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', |