[upstream] Fix flaky phpunit tests because of phpunit.xml.dist bug in core; forward-port fix
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3586128. -->
Reported by: [penyaskito](https://www.drupal.org/user/959536)
Related to !954
>>>
<h3 id="overview">Overview</h3>
<p>We've long suffered from</p>
<pre>UnexpectedValueException: RecursiveDirectoryIterator::__construct(/builds/project/canvas/web/sites/simpletest/36558090/files/config/sync): Failed to open directory: No such file or directory</pre><p>We had a hack for retrying, which has not been working as expected lately.</p>
<p>This was fixed in core already: <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/drupal/issues/3582249" title="Status: Closed (fixed)">#3582249: [random test failure] PHPUnit scans sites/simpletest while other tests are deleting from it</a></span>, but not released yet, and probably will never be backported to 11.2.</p>
<h3 id="proposed-resolution">Proposed resolution</h3>
<p>Hack phpunit.dist.xml, which is the fix core did. No need to retries, a definitive fix, and no harm when we test with ^11.4 as it will be a no-op.</p>
<h3 id="ui-changes">User interface changes</h3>
<p>None.</p>
> Related issue: [Issue #3582249](https://www.drupal.org/node/3582249)
issue