Skip to content

[E2E] Rescue from Net::Readtimeout errors on clicks

John McDonnell requested to merge jmd/handle-net-readtimeout-errors-clicks into master

What does this MR do and why?

#349165 (closed) was a previous issue where this was encountered, but we do still see this error occur.

While these errors could happen when using visit calls, we typically drive the E2E test suite via navigating with clicks on buttons, so this would seem to be the most impactful place to add this additional error handling.

Click to expand
"/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/3.0.0/net/protocol.rb:219:in `rbuf_fill'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/3.0.0/net/protocol.rb:193:in `readuntil'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/3.0.0/net/protocol.rb:203:in `readline'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/3.0.0/net/http/response.rb:42:in `read_status_line'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/3.0.0/net/http/response.rb:31:in `read_new'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/3.0.0/net/http.rb:1557:in `block in transport_request'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/3.0.0/net/http.rb:1548:in `catch'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/3.0.0/net/http.rb:1548:in `transport_request'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/3.0.0/net/http.rb:1521:in `request'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/selenium-webdriver-4.9.0/lib/selenium/webdriver/remote/http/default.rb:119:in `response_for'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/selenium-webdriver-4.9.0/lib/selenium/webdriver/remote/http/default.rb:77:in `request'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/selenium-webdriver-4.9.0/lib/selenium/webdriver/remote/http/common.rb:59:in `call'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/selenium-webdriver-4.9.0/lib/selenium/webdriver/remote/bridge.rb:619:in `execute'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/selenium-webdriver-4.9.0/lib/selenium/webdriver/remote/bridge.rb:390:in `click_element'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/selenium-webdriver-4.9.0/lib/selenium/webdriver/common/element.rb:77:in `click'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/capybara-3.39.2/lib/capybara/selenium/node.rb:108:in `click'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/capybara-3.39.2/lib/capybara/selenium/extensions/file_input_click_emulation.rb:6:in `click'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/capybara-3.39.2/lib/capybara/selenium/nodes/chrome_node.rb:40:in `click'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/capybara-3.39.2/lib/capybara/node/element.rb:172:in `block in click'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/capybara-3.39.2/lib/capybara/node/element.rb:608:in `block in perform_click_action'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/capybara-3.39.2/lib/capybara/node/base.rb:84:in `synchronize'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/capybara-3.39.2/lib/capybara/node/element.rb:608:in `perform_click_action'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/capybara-3.39.2/lib/capybara/node/element.rb:171:in `click'"
/Users/john/dev/gdk/gitlab/qa/qa/page/base.rb:252:in `click_element'"
/Users/john/dev/gdk/gitlab/qa/qa/support/page/logging.rb:94:in `block in click_element'"
/Users/john/dev/gdk/gitlab/qa/qa/support/page/logging.rb:213:in `log_slow_code'"
/Users/john/dev/gdk/gitlab/qa/qa/support/page/logging.rb:94:in `click_element'"
/Users/john/dev/gdk/gitlab/qa/qa/page/main/login.rb:255:in `sign_in_using_gitlab_credentials'"
/Users/john/dev/gdk/gitlab/qa/qa/page/main/login.rb:75:in `block in sign_in_using_credentials'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/capybara-3.39.2/lib/capybara.rb:305:in `using_wait_time'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/capybara-3.39.2/lib/capybara/session.rb:809:in `using_wait_time'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/capybara-3.39.2/lib/capybara/dsl.rb:28:in `using_wait_time'"
/Users/john/dev/gdk/gitlab/qa/qa/page/main/login.rb:65:in `sign_in_using_credentials'"
/Users/john/dev/gdk/gitlab/qa/qa/flow/login.rb:32:in `block in sign_in'"
/Users/john/dev/gdk/gitlab/qa/qa/scenario/actable.rb:16:in `perform'"
/Users/john/dev/gdk/gitlab/qa/qa/flow/login.rb:28:in `sign_in'"
/Users/john/dev/gdk/gitlab/qa/qa/specs/features/browser_ui/1_manage/migration/gitlab_migration_group_spec.rb:17:in `block (3 levels) in <module:QA>'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example.rb:457:in `instance_exec'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example.rb:457:in `instance_exec'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/hooks.rb:365:in `run'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/hooks.rb:529:in `block in run_owned_hooks_for'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/hooks.rb:528:in `each'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/hooks.rb:528:in `run_owned_hooks_for'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/hooks.rb:615:in `block in run_example_hooks_for'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/hooks.rb:614:in `reverse_each'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/hooks.rb:614:in `run_example_hooks_for'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/hooks.rb:484:in `run'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example.rb:505:in `run_before_example'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example.rb:261:in `block in run'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example.rb:511:in `block in with_around_and_singleton_context_hooks'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example.rb:468:in `block in with_around_example_hooks'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/hooks.rb:486:in `block in run'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/hooks.rb:626:in `block in run_around_example_hooks_for'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example.rb:352:in `call'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:124:in `block in run'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in `loop'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in `run'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-retry-0.6.2/lib/rspec_ext/rspec_ext.rb:12:in `run_with_retry'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:37:in `block (2 levels) in setup'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example.rb:457:in `instance_exec'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example.rb:457:in `instance_exec'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/hooks.rb:390:in `execute_with'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/hooks.rb:628:in `block (2 levels) in run_around_example_hooks_for'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example.rb:352:in `call'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/hooks.rb:629:in `run_around_example_hooks_for'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/hooks.rb:486:in `run'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example.rb:468:in `with_around_example_hooks'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example.rb:511:in `with_around_and_singleton_context_hooks'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example.rb:259:in `run'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example_group.rb:646:in `block in run_examples'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example_group.rb:642:in `map'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example_group.rb:642:in `run_examples'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example_group.rb:607:in `run'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example_group.rb:608:in `block in run'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example_group.rb:608:in `map'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/example_group.rb:608:in `run'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/runner.rb:121:in `block (3 levels) in run_specs'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/runner.rb:121:in `map'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/runner.rb:121:in `block (2 levels) in run_specs'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/configuration.rb:2070:in `with_suite_hooks'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/runner.rb:116:in `block in run_specs'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/reporter.rb:74:in `report'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/runner.rb:115:in `run_specs'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/runner.rb:89:in `run'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/runner.rb:71:in `run'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/lib/rspec/core/runner.rb:45:in `invoke'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/rspec-core-3.12.0/exe/rspec:4:in `<top (required)>'"
/Users/john/.asdf/installs/ruby/3.0.5/bin/rspec:25:in `load'"
/Users/john/.asdf/installs/ruby/3.0.5/bin/rspec:25:in `<top (required)>'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/site_ruby/3.0.0/bundler/cli/exec.rb:58:in `load'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/site_ruby/3.0.0/bundler/cli/exec.rb:58:in `kernel_load'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/site_ruby/3.0.0/bundler/cli/exec.rb:23:in `run'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/site_ruby/3.0.0/bundler/cli.rb:492:in `exec'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/site_ruby/3.0.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/site_ruby/3.0.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/site_ruby/3.0.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/site_ruby/3.0.0/bundler/cli.rb:34:in `dispatch'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/site_ruby/3.0.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/site_ruby/3.0.0/bundler/cli.rb:28:in `start'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/bundler-2.4.17/exe/bundle:37:in `block in <top (required)>'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/site_ruby/3.0.0/bundler/friendly_errors.rb:117:in `with_friendly_errors'"
/Users/john/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/bundler-2.4.17/exe/bundle:29:in `<top (required)>'"
/Users/john/.asdf/installs/ruby/3.0.5/bin/bundle:25:in `load'"
/Users/john/.asdf/installs/ruby/3.0.5/bin/bundle:25:in `<main>'"]

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

I've often run into this on GDK locally, shortly after restarting GDK services, but this is difficult to reproduce consistently. The symptoms usually include trying to run an E2E spec shortly after restarting GDK, and it takes 30-60 seconds for GDK to start -- the test sometimes hangs even after the login page finally appears before seeing this error present itself.

However - I've also noted that this can be easily reproduce by using the QA_SIMULATE_SLOW_CONNECTION as we seem to encounter this during the login process in the tests there as well.

`

  1. export QA_SIMULATE_SLOW_CONNECTION=true
  2. bundle exec rspec qa/specs/features/browser_ui/...

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by John McDonnell

Merge request reports