Problem/Motivation
This is a very simple test but none of the methods change state, so it's an easy candidate to convert to 'calling protected methods from one public one'.
Steps to reproduce
From my local:
Time: 00:23.463, Memory: 4.00 MB
OK (10 tests, 104 assertions)
Time: 00:04.055, Memory: 6.00 MB
OK (1 test, 95 assertions)
The test can take over a minute on Drupal CI, e.g. https://git.drupalcode.org/project/drupal/-/jobs/2512850 so could be more dramatic on there.
Proposed resolution
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | after_patch_test_improve.png | 114.66 KB | pooja_sharma |
| #5 | before_patch.png | 110.52 KB | pooja_sharma |
Issue fork drupal-3469573
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:
- 3469573-speed-up-elementstest
changes, plain diff MR !9286
Comments
Comment #3
catchLast 11.x daily test run had this at 57s https://git.drupalcode.org/project/drupal/-/jobs/2502553
This goes down from around 8s on the MR pipeline gitlab https://git.drupalcode.org/project/drupal/-/jobs/2512911
Comment #4
catchComment #5
pooja_sharma commentedCame from #3390193, however this issue is already in NR, so just reviewing it
Changes looks good: used protected from public along with relevant changes included to call those protected methods, apart from nothing seems to be left, verified test changes on local, its output on the basis of time & memory usage as follow:
Before applied MR changes test takes : Time:
00:21.007,Memory: 6.00 MBAfter applied MR changes test takes: Time:
00:04.700,Memory: 6.00 MBobserved test & its resources usage improved & attached screenshot as well, moving to RTBC
Comment #11
nod_Committed and pushed 6aae927629 to 11.x and 1d5a6d44d6 to 11.0.x and 6adaeadd8f to 10.4.x and 20f60160dd to 10.3.x. Thanks!