From f34de820ac18c6ae7f624da845ec1f681b0edf62 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Fri, 14 Dec 2018 18:57:02 +0100 Subject: [PATCH] Test stabilization: Creation of and communication to remote Selenium browser instance fails in load intense CI scenarios. --- test/browser_test_helper.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/browser_test_helper.rb b/test/browser_test_helper.rb index e07029732..6bd9bb52e 100644 --- a/test/browser_test_helper.rb +++ b/test/browser_test_helper.rb @@ -93,10 +93,22 @@ class TestCase < Test::Unit::TestCase if ENV['BROWSER_VERSION'] caps.version = ENV['BROWSER_VERSION'] end + + # (ironically) required for timeout checks + # https://github.com/zalando/zalenium/issues/469#issuecomment-371417340 + # https://opensource.zalando.com/zalenium/#usage + caps['idleTimeout'] = 300 + + http_client = Selenium::WebDriver::Remote::Http::Default.new( + open_timeout: 120, + read_timeout: 120 + ) + local_browser = Selenium::WebDriver.for( :remote, url: ENV['REMOTE_URL'], desired_capabilities: caps, + http_client: http_client, ) @browsers[local_browser.hash] = local_browser browser_instance_preferences(local_browser)