mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 02:48:28 +08:00
DEV: Patch capybara to ignore client-triggered errors (#19972)
In dev/prod, these are absorbed by unicorn. Most commonly, they occur when a client interrupts a message-bus long-polling request. Also reverts the EPIPE workaround introduced in 011c9b997331a0c5a88a5d498bfcc0d8b06cf22d
This commit is contained in:
@ -252,6 +252,17 @@ RSpec.configure do |config|
|
||||
capybara_config.server_port = 31_337 + ENV["TEST_ENV_NUMBER"].to_i
|
||||
end
|
||||
|
||||
module IgnoreUnicornCapturedErrors
|
||||
def raise_server_error!
|
||||
super
|
||||
rescue EOFError, Errno::ECONNRESET, Errno::EPIPE, Errno::ENOTCONN => e
|
||||
# Ignore these exceptions - caused by client. Handled by unicorn in dev/prod
|
||||
# https://github.com/defunkt/unicorn/blob/d947cb91cf/lib/unicorn/http_server.rb#L570-L573
|
||||
end
|
||||
end
|
||||
|
||||
Capybara::Session.class_eval { prepend IgnoreUnicornCapturedErrors }
|
||||
|
||||
# The valid values for SELENIUM_BROWSER_LOG_LEVEL are:
|
||||
#
|
||||
# OFF
|
||||
|
Reference in New Issue
Block a user