Project

General

Profile

Actions

Defect #44808

open

Random test failure in OauthProviderSystemTest#test_application_creation_and_authorization after clicking "Create"

Defect #44808: Random test failure in OauthProviderSystemTest#test_application_creation_and_authorization after clicking "Create"

Added by Go MAEDA about 3 hours ago. Updated about 3 hours ago.

Status:
Resolved
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:33:in 'block (2 levels) in <class:OauthProviderSystemTest>'
    test/test_helper.rb:144:in 'ActiveSupport::TestCase#with_settings'
    test/system/oauth_provider_test.rb:16:in 'block in <class:OauthProviderSystemTest>'

This is the same problem as #44786, but in a different part of the test. After the "Create" button is clicked, the test calls assert_text while the browser may still be showing the new application form. If the redirect to the application page replaces the page while Capybara is reading its text, 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 assert_text.


Files

Updated by Go MAEDA about 3 hours ago Actions #1

  • Status changed from New to Resolved
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the fix in r25487.

Actions

Also available in: PDF Atom