diff options
author | Matthew Draper <matthew@trebex.net> | 2016-07-02 06:38:43 +0930 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-02 06:38:43 +0930 |
commit | 803ee80c88e04f1d9e81ca0dc7e71986b81784af (patch) | |
tree | 67fd8b1d4050653809732a24977221fbb9628aae /actioncable/test/connection | |
parent | 1c7a3230ba28c578835d52c5b6d086c3b38f1b20 (diff) | |
parent | 3120b51de7d391d04eae5332b91c753d0643cbd4 (diff) | |
download | rails-803ee80c88e04f1d9e81ca0dc7e71986b81784af.tar.gz rails-803ee80c88e04f1d9e81ca0dc7e71986b81784af.tar.bz2 rails-803ee80c88e04f1d9e81ca0dc7e71986b81784af.zip |
Merge pull request #25615 from tinco/close_hijacked_socket
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', |