Merge branch '9446-refactor-keep-parallel-write-strategy'
[arvados.git] / services / api / test / integration / websocket_test.rb
index d1b8c34a43be5df0736475996b378002e87b6baa..98ae103d1a464fbb550ba46f8c3669736eae3981 100644 (file)
@@ -31,7 +31,7 @@ class WebsocketTest < ActionDispatch::IntegrationTest
       ws.on :open do |event|
         opened = true
         if timeout
-          EM::Timer.new 4 do
+          EM::Timer.new 8 do
             too_long = true if close_status.nil?
             EM.stop_event_loop
           end
@@ -383,7 +383,7 @@ class WebsocketTest < ActionDispatch::IntegrationTest
     ws_helper :admin, false do |ws|
       ws.on :open do |event|
         ws.send ({method: 'subscribe', filters: [['object_uuid', 'is_a', 'arvados#human']]}.to_json)
-        EM::Timer.new 3 do
+        EM::Timer.new 6 do
           # Set a time limit on the test because after unsubscribing the server
           # still has to process the next event (and then hopefully correctly
           # decides not to send it because we unsubscribed.)
@@ -597,10 +597,10 @@ class WebsocketTest < ActionDispatch::IntegrationTest
       ws.on :message do |event|
         d = Oj.strict_load event.data
         case state
-        when (1..EventBus::MAX_FILTERS)
+        when (1..Rails.configuration.websocket_max_filters)
           assert_equal 200, d["status"]
           state += 1
-        when (EventBus::MAX_FILTERS+1)
+        when (Rails.configuration.websocket_max_filters+1)
           assert_equal 403, d["status"]
           ws.close
         end
@@ -608,7 +608,7 @@ class WebsocketTest < ActionDispatch::IntegrationTest
 
     end
 
-    assert_equal 17, state
+    assert_equal Rails.configuration.websocket_max_filters+1, state
 
   end