Problem/Motivation

MyrestPathProcessorScopeTest::testUnrelatedRoutesAreUntouched fails when the module's suite is run as a whole and passes every time it is run on its own or beside one other test class. It has done so in five consecutive pieces of work, always the same test and always the same way, so it is not a coincidence to be reported per branch: something the tests running before it leave behind decides the result.

A test that fails on unrelated work is worse than no test. It teaches everybody to re-run the pipeline instead of reading it, and the day this test catches the regression it was written for, the failure will be dismissed the same way.

Proposed resolution

  • Reproduce it the way the pipeline runs the suite — run-tests.sh with concurrency, not a single PHPUnit process — and bisect by test class to find which one it follows when it fails.
  • Name the state that leaks: the candidates are the alias and route caches, the resource plugin definitions, and the site the previous class left installed.
  • Fix the isolation rather than the assertion. The behaviour under test — that an unrelated route is left untouched — is the guarantee this test exists for and must keep being asserted.
  • Run the whole suite repeatedly afterwards to show the failure is gone rather than moved.

Remaining tasks

Everything.

Issue fork myrest-3619196

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

sergeydruua created an issue. See original summary.

  • sergeydruua committed 0b33997f on 1.0.x
    Issue #3619196: Assert the path processor scope without a web server in...
sergeydruua’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

sergeydruua’s picture

Status: Fixed » Closed (fixed)