- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Now that ๐ phpcs stopped working since the switch to testing on Drupal 10.0.x by default Fixed is finally done, this is the next most important issue! Will continue this tomorrow.
- Assigned to omkar.podey
- ๐ฎ๐ณIndia omkar.podey
Drupal CI behaves weirdly , does not run tests according to
drupalci.yml
, hence the retests. - @omkarpodey opened merge request.
- ๐ฎ๐ณIndia omkar.podey
Test times
New PR
kernel - 6:24 mins
functional - 13 mins
build - 14 minsbaseline
kernel - 7.24
functional - 5.42
build - 12 mins - ๐ฎ๐ณIndia omkar.podey
We can clearly see that functional tests are running slower , so i thought the only thing that functional tests are using that we changed is
package_manager/tests/src/Traits/FixtureUtilityTrait.php
but even without the changes in it they still seem to run slower. - ๐ฎ๐ณIndia omkar.podey
Performance test results
The old finder and the RecursiveDirectoryIterator are definitely looking at different files and the RecursiveDirectoryIterator is making more passes on the same files (indicated by the numbers in front of the discovered file names)
- ๐ฎ๐ณIndia omkar.podey
From the latest test i think i can conclude 2 things
- There are no weird subdirectory inside subdirectory folders from a previous run or any old undeleted files
- The
RecursiveDirectoryIterator
is the only one that see's the weird structure.
- Issue was unassigned.
- Assigned to wim leers
- ๐ฎ๐ณIndia omkar.podey
I did try to create a symlink locally but was unable to recreate the same pattern of paths.
- Issue was unassigned.
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
It doesn't need to be me who works on this, so if somebody wants to dig into this before I get to it, please do!
- Assigned to yash.rode
- ๐ฎ๐ณIndia yash.rode pune
When I debugged this I get ~7500 from
withOutFinder()
and ~250 files fromwithFinder()
. - ๐ฎ๐ณIndia yash.rode pune
Test failing with on
self::assertSame($txt_files_finder, $txt_file_no_finder);
line in\Drupal\Tests\automatic_updates\Unit\PerformanceTest::testPerformance()
. The results are identical still the test is failing. - Assigned to wim leers
- Status changed to Needs review
over 1 year ago 11:16am 27 February 2023 - Status changed to Needs work
over 1 year ago 2:15pm 27 February 2023 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Reproduced the infamous recursive Omkar locally:
โฆ + '/Users/wim.leers/core/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/sites/simpletest/36713557/ygxJCv2dGVN5BPYVCRvz/modules/example/.git/ignore.txt' => 1 + '/Users/wim.leers/core/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/sites/simpletest/18800034/files/config_gKQI85yVN-z5lKiIDAsy5GJSfwwYfJeBfF3z64BkA6qwCgXD-pg4m_mECxzSHxcTvdV_RwLHCQ/sync/README.txt' => 1 + '/Users/wim.leers/core/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/sites/simpletest/18067332/bP1bRMh0Cq4TfBGnoQUr/core/node_modules/ignore.txt' => 1 + '/Users/wim.leers/core/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/omkar/sites/simpletest/18067332/bP1bRMh0Cq4TfBGnoQUr/sites/default/stage.txt' => 1 โฆ
โ I'll continue here.
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Turns out that the reason the
3321933-performance-test
is actually very simple:withFinder()
never calls\Symfony\Component\Finder\Finder::followLinks()
, which is why it is ignoring symlinks entirelywithOutFinder()
specifies$flags |= \FilesystemIterator::FOLLOW_SYMLINKS;
, which causes it to do the opposite
โ the recursive Omkar mystery is solved: https://git.drupalcode.org/project/automatic_updates/-/merge_requests/64...
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
That puts us at:
+ '/Users/wim.leers/core/omkar/core/.deprecation-ignore.txt' => 1 '/Users/wim.leers/core/omkar/core/INSTALL.sqlite.txt' => 1 '/Users/wim.leers/core/omkar/core/INSTALL.pgsql.txt' => 1 '/Users/wim.leers/core/omkar/core/lib/Drupal/Core/README.txt' => 1 @@ @@ '/Users/wim.leers/core/omkar/sites/simpletest/29115714/fXQhTRGlQ1k5Az4B6AYc/sites/example.com/files/ignore.txt' => 1 '/Users/wim.leers/core/omkar/sites/simpletest/29115714/fXQhTRGlQ1k5Az4B6AYc/sites/simpletest/ignore.txt' => 1 '/Users/wim.leers/core/omkar/sites/simpletest/29115714/fXQhTRGlQ1k5Az4B6AYc/private/ignore.txt' => 1 + '/Users/wim.leers/core/omkar/sites/simpletest/29115714/fXQhTRGlQ1k5Az4B6AYc/.git/ignore.txt' => 1 '/Users/wim.leers/core/omkar/sites/simpletest/29115714/fXQhTRGlQ1k5Az4B6AYc/modules/example/node_modules/ignore.txt' => 1 + '/Users/wim.leers/core/omkar/sites/simpletest/29115714/fXQhTRGlQ1k5Az4B6AYc/modules/example/.git/ignore.txt' => 1 '/Users/wim.leers/core/omkar/sites/simpletest/11853257/files/config_MnP16Yj8pfbM5wIkoIceZlpcxP5K1FivVn1ZzPJ9iY0ZkGih2Fc-hM2q
โ better, but still not perfect.
Reason for that: we're again not yet matching
Finder
's behavior, which has this:public function __construct() { $this->ignore = static::IGNORE_VCS_FILES | static::IGNORE_DOT_FILES; }
โฆ while we have nothing like that at all in our logic in
PerformanceTest
.Now tests pass:
PHPUnit 9.5.26 by Sebastian Bergmann and contributors. Testing /Users/wim.leers/core/modules/contrib/automatic_updates/tests/src/Unit .................... 20 / 20 (100%) Time: 00:31.553, Memory: 10.00 MB OK (20 tests, 40 assertions) Process finished with exit code 0
So it's faster 100% of the time. Adding
var_dump(['with finder' => $with_finder, 'without finder' => $without_finder]);
makes that more clear:
Rarray(2) { ["with finder"]=> float(0.9062411785125732) ["without finder"]=> float(0.6564769744873047) } Rarray(2) { ["with finder"]=> float(0.9076869487762451) ["without finder"]=> float(0.6771509647369385) } Rarray(2) { ["with finder"]=> float(0.9273748397827148) ["without finder"]=> float(0.6514010429382324) } Rarray(2) { ["with finder"]=> float(0.9032847881317139) ["without finder"]=> float(0.6541171073913574) } <snip>
I bet that the root cause for the actual MR (https://git.drupalcode.org/project/automatic_updates/-/merge_requests/59...) was similar: none of the code in
package_manager
is callingFinder::followLinks()
! - @wim-leers opened merge request.
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
New MR opened โฆ waiting for it to fail before pushing the commit that will remove
\FilesystemIterator::FOLLOW_SYMLINKS
๐ค - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Looks like
\FilesystemIterator::CURRENT_AS_SELF
is causingphpstan
confusion? ๐ณ ๐ฌ Trying moreโฆ - Issue was unassigned.
- Status changed to Needs review
over 1 year ago 12:45pm 28 February 2023 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Well well well โฆ looks like this even works just like that, by just literally porting the MR I had created months ago against
8.x-2.x
to3.0.x
(and fixing the PHPStan violations which even then were not running anymore apparently) โฆ ๐ณI bet:
- it's because some significant test infrastructure changes happened since #18 (January 4, almost 2 months ago) โ most notably
๐
package_manager_bypass should *minimally* bypass php-tuf/composer-stager, not maximally
Fixed
and
๐
The 'fake_site' fixture cannot be using with `composer show` because the packages are not installed
Fixed
(which specifically touches on
symlink
-related things). - those have removed a significant number of symlinks that the file system iterating/filtering was previously choking on.
But! It's still slower! The functional tests no longer time out like in January, but they run excruciatingly slow. So pushed a commit just now to stop following symlinks, just like the validators were doing previously.
- it's because some significant test infrastructure changes happened since #18 (January 4, almost 2 months ago) โ most notably
๐
package_manager_bypass should *minimally* bypass php-tuf/composer-stager, not maximally
Fixed
and
๐
The 'fake_site' fixture cannot be using with `composer show` because the packages are not installed
Fixed
(which specifically touches on
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Hah!
ec30ba81
even finished befored2c2aac2
even despite it starting tests roughly an hour laterโฆ ๐ In fact, it's currently still going:โฆ 00:51:49.032 Drupal\Tests\automatic_updates_extensions\Functional\PreUpda 3 passes 01:21:38.843 Drupal\Tests\automatic_updates_extensions\Functional\UpdateE 3 passes 01:21:40.820 Drupal\Tests\automatic_updates_extensions\Functional\Display 2 passes 01:21:41.494 Drupal\Tests\automatic_updates\Functional\TableLooksCorrectT 2 passes โฆ
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
โ ๏ธ While #49 matches
HEAD
's current behavior, after ๐ Add symlink support to Composer Stager 2.0, require that version, and simplify UX & tests accordingly Fixed lands, we will be accepting most symlinks. Which means validators should also follow them while validating. Captured at #3319507-26: [upstream] Support more symlinks, document why certain symlinks are not supported โ .CorePackageManifestTest
andFixtureUtilityTrait
will not be affected. - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Posted informative comments on the open MR, closed all other MRs. This is now hard-blocked on review, at last! ๐ฅณ
- ๐บ๐ธUnited States phenaproxima Massachusetts
This looks really good. I think it could maybe use a little consolidation and documentation but I have no objections otherwise.
- Assigned to wim leers
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
#3305568: Create a validator that detects duplicate info.yml files in the stage on apply โ introduced
DuplicateInfoFileValidator
. It is what introducedignoreUnreadableDirs()
without documenting why. So that leaves some lack of clarity about how we should support this.So I propose to instead just reuse core's
ExtensionDiscovery
๐ - Status changed to Needs work
over 1 year ago 4:59pm 28 February 2023 - ๐บ๐ธUnited States phenaproxima Massachusetts
A question, a request to revert something that didn't need to change, and a couple of nits. Then this, in my opinion, is ready and I will be glad to see it land!
- Issue was unassigned.
- Status changed to RTBC
over 1 year ago 6:50pm 28 February 2023 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
All feedback addressed! ๐ Some really good catches in there! ๐ Thanks for the thorough review ๐
- ๐บ๐ธUnited States phenaproxima Massachusetts
Re-titling, because the final MR does not document why we need symfony/config. That's okay, though.
-
phenaproxima โ
committed bd2ce8e4 on 3.0.x authored by
Wim Leers โ
Issue #3321933 by omkar.podey, Wim Leers, tedbow, yash.rode,...
-
phenaproxima โ
committed bd2ce8e4 on 3.0.x authored by
Wim Leers โ
- Status changed to Fixed
over 1 year ago 7:24pm 28 February 2023 - ๐บ๐ธUnited States phenaproxima Massachusetts
Glad to see this alpha blocker bite the dust!
- ๐บ๐ธUnited States effulgentsia
Re-titling, because the final MR does not document why we need symfony/config.
Here's a follow-up for that: ๐ Remove dependency on symfony/config Fixed
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
#61: I did document that as part of working on this issue: see #11, and ๐ Add symfony/config to core's dependencies for package_manager Closed: duplicate . This is all stated in the issue summary. Nowhere in Drupal core is it documented in code why a certain composer package is being depended upon, so doing that here would've been out of scope.
Automatically closed - issue fixed for 2 weeks with no activity.