From ad2eff55c8254a942bc2ed4a2ea4b1bbcef8ff61 Mon Sep 17 00:00:00 2001
From: Lauri Eskola <lauri.eskola@acquia.com>
Date: Sun, 29 Oct 2023 17:45:15 +0200
Subject: [PATCH] Issue #3395989 by catch, smustgrave, longwave, Spokje:
 [random test failure] ComponentsTaggedReleaseTest sometimes fails

---
 core/tests/Drupal/BuildTests/Framework/BuildTestBase.php   | 5 ++++-
 .../Drupal/BuildTests/Framework/Tests/BuildTestTest.php    | 7 -------
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/core/tests/Drupal/BuildTests/Framework/BuildTestBase.php b/core/tests/Drupal/BuildTests/Framework/BuildTestBase.php
index a91e02156783..ded5b3104128 100644
--- a/core/tests/Drupal/BuildTests/Framework/BuildTestBase.php
+++ b/core/tests/Drupal/BuildTests/Framework/BuildTestBase.php
@@ -567,6 +567,10 @@ public function copyCodebase(\Iterator $iterator = NULL, $working_dir = NULL) {
    * - Call the method to get a default Finder object which can then be
    *   modified for other purposes.
    *
+   * Note that the vendor directory is deliberately not included in the
+   * directory exclusions here, so that packages are copied and composer does
+   * not attempt to download them from packagist/github during test runs.
+   *
    * @return \Symfony\Component\Finder\Finder
    *   A Finder object ready to iterate over core codebase.
    */
@@ -577,7 +581,6 @@ public function getCodebaseFinder() {
       ->in($this->getDrupalRoot())
       ->notPath('#^sites/default/files#')
       ->notPath('#^sites/simpletest#')
-      ->notPath('#^vendor#')
       ->notPath('#^core/node_modules#')
       ->notPath('#^sites/default/settings\..*php#')
       ->ignoreDotFiles(FALSE)
diff --git a/core/tests/Drupal/BuildTests/Framework/Tests/BuildTestTest.php b/core/tests/Drupal/BuildTests/Framework/Tests/BuildTestTest.php
index 5945dfb14cdb..5eeca68e12ea 100644
--- a/core/tests/Drupal/BuildTests/Framework/Tests/BuildTestTest.php
+++ b/core/tests/Drupal/BuildTests/Framework/Tests/BuildTestTest.php
@@ -74,13 +74,6 @@ public function testCopyCodebaseExclude() {
           ],
         ],
       ],
-      'vendor' => [
-        'composer' => [
-          'composer' => [
-            'installed.json' => '"items": {"things"}',
-          ],
-        ],
-      ],
       'modules' => [
         'my_module' => [
           'vendor' => [
-- 
GitLab