Problem/Motivation

Following #3615596: Reduce http requests in DependencyTest I wonder if it is possible to detect a situation where drupalGet() loads a page that is already loaded, and error when this happens. We could add a reloadPage() method for cases where we explicitly want to reload the same page.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3615863

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

longwave created an issue. See original summary.

longwave’s picture

Issue tags: +Test suite performance
nicxvan’s picture

Title: Disallow duplicate HTTP requests in tests » Disallow consecutive duplicate HTTP requests in tests
catch’s picture

With #3615596: Reduce http requests in DependencyTest specifically we were reloading the page after submitting a form that redirects to that page. To catch those automatically we'd need to know which page we're on currently, rather than what the last url passed to drupalGet() was. Not sure how straightforward or not that is to implement.

longwave’s picture

Status: Active » Needs review

Maybe this is enough, although there are probably edge cases.

This MR was written with assistance from Claude Code.

mstrelan’s picture

Do we want to duplicate this for kernel test as well? It doesn't matter as much there because they are faster. They also don't have submitForm (yet).

catch’s picture

As we move more functional tests to kernel tests it would probably come in handy to have it there.

This is quite an encouraging number of test failures, should we split the actual fixes out to a separate issue so this one can concentrate on the code changes (+ stragglers)?

smustgrave’s picture

Status: Needs review » Needs work

Does appear to have test failures (assuming expected)