3036: Remove obsolete 'name' link tests.
[arvados.git] / services / api / test / integration / websocket_test.rb
index 47618004148d131ee35ed57df7bae674762ea0d0..925d879906030be0b106437d39b0f1f8561cdaa5 100644 (file)
@@ -31,8 +31,8 @@ class WebsocketTest < ActionDispatch::IntegrationTest
       ws.on :open do |event|
         opened = true
         if timeout
-          EM::Timer.new 3 do
-            too_long = true
+          EM::Timer.new 4 do
+            too_long = true if close_status.nil?
             EM.stop_event_loop
           end
         end
@@ -142,7 +142,10 @@ class WebsocketTest < ActionDispatch::IntegrationTest
           state = 3
         when 3
           human_ev_uuid = d["object_uuid"]
+          state = 4
           ws.close
+        when 4
+          assert false, "Should not get any more events"
         end
       end
 
@@ -176,7 +179,10 @@ class WebsocketTest < ActionDispatch::IntegrationTest
           state = 2
         when 2
           human_ev_uuid = d["object_uuid"]
+          state = 3
           ws.close
+        when 3
+          assert false, "Should not get any more events"
         end
       end
 
@@ -219,7 +225,10 @@ class WebsocketTest < ActionDispatch::IntegrationTest
           state = 4
         when 4
           human_ev_uuid = d["object_uuid"]
+          state = 5
           ws.close
+        when 5
+          assert false, "Should not get any more events"
         end
       end
 
@@ -260,7 +269,10 @@ class WebsocketTest < ActionDispatch::IntegrationTest
         when 3
           l2 = d["object_uuid"]
           assert_not_nil l2, "Unexpected message: #{d}"
+          state = 4
           ws.close
+        when 4
+          assert false, "Should not get any more events"
         end
       end
 
@@ -403,7 +415,10 @@ class WebsocketTest < ActionDispatch::IntegrationTest
           state = 4
         when 4
           human_ev_uuid = d["object_uuid"]
+          state = 5
           ws.close
+        when 5
+          assert false, "Should not get any more events"
         end
       end