Broadened timeout exception handling.

This commit is contained in:
Jack Walker
2020-05-12 09:52:12 +10:00
parent 92f3bdba2b
commit 878e235e0b
4 changed files with 11 additions and 11 deletions

View File

@@ -135,7 +135,7 @@ RSpec.describe 'AutoRunEngine Test', :run_on_browserstack => true do
expect(@hooks['hooked-browsers']['online']).not_to be_empty
end
rescue => exception
if exception.include?('Errno::ETIMEDOUT:')
if exception.include?('ETIMEDOUT')
print_info "Encountered possible false negative timeout error checking exception."
expect(exception).to include('Failed to open TCP connection to hub-cloud.browserstack.com:80')
elsif exception.include?('401 Unauthorized')

View File

@@ -132,7 +132,7 @@ RSpec.describe 'Browser Details Handler', :run_on_browserstack => true do
expect(@hooks['hooked-browsers']['online']).not_to be_empty
end
rescue => exception
if exception.include?('Errno::ETIMEDOUT:')
if exception.include?('ETIMEDOUT')
print_info "Encountered possible false negative timeout error checking exception."
expect(exception).to include('Failed to open TCP connection to hub-cloud.browserstack.com:80')
elsif exception.include?('401 Unauthorized')

View File

@@ -131,7 +131,7 @@ RSpec.describe 'Browser hooking with Websockets', :run_on_browserstack => true d
expect(@hooks['hooked-browsers']['online']).not_to be_empty
end
rescue => exception
if exception.include?('Errno::ETIMEDOUT:')
if exception.include?('ETIMEDOUT')
print_info "Encountered possible false negative timeout error checking exception."
expect(exception).to include('Failed to open TCP connection to hub-cloud.browserstack.com:80')
elsif exception.include?('401 Unauthorized')

View File

@@ -140,7 +140,7 @@ RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do
result_data = JSON.parse(response.body)
expect(result_data['success']).to eq "true"
rescue => exception
if exception.include?('Errno::ETIMEDOUT:')
if exception.include?('ETIMEDOUT')
print_info "Encountered possible false negative timeout error checking exception."
expect(exception).to include('Failed to open TCP connection to hub-cloud.browserstack.com:80')
elsif exception.include?('401 Unauthorized')
@@ -163,7 +163,7 @@ RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do
result_data = JSON.parse(response.body)
expect(result_data['success']).to eq "true"
rescue => exception
if exception.include?('Errno::ETIMEDOUT:')
if exception.include?('ETIMEDOUT')
print_info "Encountered possible false negative timeout error checking exception."
expect(exception).to include('Failed to open TCP connection to hub-cloud.browserstack.com:80')
elsif exception.include?('401 Unauthorized')
@@ -186,7 +186,7 @@ RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do
result_data = JSON.parse(response.body)
expect(result_data['success']).to eq "true"
rescue => exception
if exception.include?('Errno::ETIMEDOUT:')
if exception.include?('ETIMEDOUT')
print_info "Encountered possible false negative timeout error checking exception."
expect(exception).to include('Failed to open TCP connection to hub-cloud.browserstack.com:80')
elsif exception.include?('401 Unauthorized')
@@ -210,7 +210,7 @@ RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do
result_data = JSON.parse(response.body)
expect(result_data['success']).to eq "true"
rescue => exception
if exception.include?('Errno::ETIMEDOUT:')
if exception.include?('ETIMEDOUT')
print_info "Encountered possible false negative timeout error checking exception."
expect(exception).to include('Failed to open TCP connection to hub-cloud.browserstack.com:80')
elsif exception.include?('401 Unauthorized')
@@ -234,7 +234,7 @@ RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do
result_data = JSON.parse(response.body)
expect(result_data['success']).to eq "true"
rescue => exception
if exception.include?('Errno::ETIMEDOUT:')
if exception.include?('ETIMEDOUT')
print_info "Encountered possible false negative timeout error checking exception."
expect(exception).to include('Failed to open TCP connection to hub-cloud.browserstack.com:80')
elsif exception.include?('401 Unauthorized')
@@ -265,7 +265,7 @@ RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do
result_data = JSON.parse(response.body)
expect(result_data['success']).to eq "true"
rescue => exception
if exception.include?('Errno::ETIMEDOUT:')
if exception.include?('ETIMEDOUT')
print_info "Encountered possible false negative timeout error checking exception."
expect(exception).to include('Failed to open TCP connection to hub-cloud.browserstack.com:80')
elsif exception.include?('401 Unauthorized')
@@ -289,7 +289,7 @@ RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do
result_data = JSON.parse(response.body)
expect(result_data['success']).to eq "true"
rescue => exception
if exception.include?('Errno::ETIMEDOUT:')
if exception.include?('ETIMEDOUT')
print_info "Encountered possible false negative timeout error checking exception."
expect(exception).to include('Failed to open TCP connection to hub-cloud.browserstack.com:80')
elsif exception.include?('401 Unauthorized')
@@ -316,7 +316,7 @@ RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do
result_data = JSON.parse(response.body)
expect(result_data['success']).to eq "true"
rescue => exception
if exception.include?('Errno::ETIMEDOUT:')
if exception.include?('ETIMEDOUT')
print_info "Encountered possible false negative timeout error checking exception."
expect(exception).to include('Failed to open TCP connection to hub-cloud.browserstack.com:80')
elsif exception.include?('401 Unauthorized')