Project

General

Profile

Actions

Defect #44786

closed

Random test failure in OauthProviderSystemTest#test_application_creation_and_authorization

Defect #44786: Random test failure in OauthProviderSystemTest#test_application_creation_and_authorization

Added by Go MAEDA 14 days ago. Updated 13 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Code cleanup/refactoring
Target version:
Resolution:
Fixed
Affected version:

Description

OauthProviderSystemTest#test_application_creation_and_authorization randomly fails on CI with the following error:

OauthProviderSystemTest#test_application_creation_and_authorization:
Selenium::WebDriver::Error::UnknownError: unknown error: unhandled inspector error: {"code":-32000,"message":"Node with given id does not belong to the document"}
  (Session info: chrome=157.0.8103.78)
    test/system/oauth_provider_test.rb:88:in 'block (2 levels) in <class:OauthProviderSystemTest>'
    test/test_helper.rb:144:in 'ActiveSupport::TestCase#with_settings'
    test/system/oauth_provider_test.rb:70:in 'block in <class:OauthProviderSystemTest>'

After the "Authorize" button is clicked, the test calls find 'p' while the browser is still showing the authorization page. If the redirect replaces the page during the search, Chrome raises the error above. Capybara does not retry on UnknownError, so the test fails.

The attached patch fixes this by waiting for the redirect with assert_current_path before calling find.


Files

Actions

Also available in: PDF Atom