Project

General

Profile

Actions

Defect #44809

closed

System tests fail with Chrome 158 because Capybara cannot reset sessions

Defect #44809: System tests fail with Chrome 158 because Capybara cannot reset sessions

Added by Go MAEDA 8 days ago. Updated 4 days ago.

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

Description

Since Chrome 158, many system tests fail, both locally and on GitHub Actions:
https://github.com/redmine/redmine/actions/runs/46119154831/job/140899606752

This is caused by an incompatibility between Capybara 3.40.0 and Chrome 158: https://github.com/teamcapybara/capybara/issues/2865

After each test, Capybara resets the session by sending Storage.clearDataForOrigin with the origin *. Chrome 158 rejects it with "invalid argument: * is not a valid URL". As a result, the cookies are not cleared, and the next test starts logged in.

A version of Capybara that fixes this has not been released yet. The attached patch works around the problem in ApplicationSystemTestCase. It clears the cookies with Network.clearBrowserCookies, and the other storage with the origin of the application. It has no effect once Capybara stops sending the origin *, and should be removed when a fixed version is released.


Files

Updated by Takenori TAKAKI 6 days ago Actions #1

I tested the patch with Chrome 158, and it fixes the problem.

Updated by Go MAEDA 5 days ago Actions #2

  • Status changed from New to Resolved
  • Assignee set to Go MAEDA
  • Target version changed from Candidate for next minor release to 6.1.7

Committed the patch in r25498.

Updated by Go MAEDA 5 days ago Actions #3

  • Status changed from Resolved to Closed
  • Resolution set to Fixed

Merged the fix into the stable branches in r25499 and r25500.

Updated by Marius BĂLTEANU 4 days ago Actions #4

  • Target version changed from 6.1.7 to 6.0.13
Actions

Also available in: PDF Atom