Problem/Motivation

This test failed twice in different but similar ways on a recent MR:
https://git.drupalcode.org/project/drupal/-/jobs/13046921

Symfony\Component\Finder\Exception\AccessDeniedException: RecursiveDirectoryIterator::__construct(/tmp/package_manager_testing_roottest85909388): Failed to open directory: No such file or directory

https://git.drupalcode.org/project/drupal/-/jobs/13047677

Symfony\Component\Finder\Exception\AccessDeniedException: RecursiveDirectoryIterator::__construct(/tmp/.!!slQ): Failed to open directory: No such file or directory

Steps to reproduce

Proposed resolution

The MR gives both tests a unique directory under the OS temporary directory. tearDown() removes it

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3632578

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

acbramley created an issue. See original summary.

acbramley’s picture

joelpittet’s picture

joelpittet’s picture

Status: Active » Needs review

Generated with the help of an LLM.

The test runs Finder over the whole OS temporary directory. Finder uses depth(1), so it opens every subdirectory there. Other tests delete their directories in /tmp during the scan. RecursiveDirectoryIterator then throws AccessDeniedException. The CI logs show this for package_manager_testing_root* and a hidden directory.

The test removed its symlink only after the assertions passed. A failed run left the link behind, and later runs failed on assertCount(1). testComposerRecipeDirectory() had the same problem with the fixed path /tmp/test.

The MR gives both tests a unique directory under the OS temporary directory. tearDown() removes it.

Local stress test, with four processes creating and deleting directories in TMPDIR:

  • Before: 18 of 20 runs failed.
  • After: 20 of 20 runs passed. run-tests.sh with --concurrency 8 --repeat 16 passed 16 of 16.
smustgrave’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Had to apply the diff to fully read it but I say lets give this approach a shot.

catch’s picture

Status: Reviewed & tested by the community » Needs work

One comment nit on the MR.

joelpittet’s picture

Status: Needs work » Reviewed & tested by the community

Nit addressed, back to RTBC because no code changes.

  • catch committed f8091268 on main
    fix: #3632578 [random test failure] RecipeFinderTest::...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to main, thanks!

This test only appears to be in main, so leaving this there.

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.