Browse Source

Maintenance: Improve retrying of tests when exceptions occur on the WS handler.

Martin Gruner 1 year ago
parent
commit
cc8b60ab4e
1 changed files with 4 additions and 0 deletions
  1. 4 0
      spec/support/capybara/websocket_server.rb

+ 4 - 0
spec/support/capybara/websocket_server.rb

@@ -34,6 +34,10 @@ RSpec.configure do |config|
 
     # give thread time to terminate
     sleep 0.01 while websocket_server.status
+  rescue => e
+    # Handle any errors occuring within this hook, for example Net::ReadTimeout errors of the WS server.
+    #   Otherwise, they would not cause the retry to kick in, but abort the process.
+    example.example.set_exception(e)
   end
 
   def ensure_port_available!(port)