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.shwith 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
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
Comment #4
sergeydruua commentedComment #6
sergeydruua commented