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

Issue fork drupal-3469573

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

catch created an issue. See original summary.

catch’s picture

Status: Active » Needs review

Last 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

catch’s picture

Title: Speed up ElementsTest » Speed up ElementTest
pooja_sharma’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new110.52 KB
new114.66 KB

Came 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 MB

After applied MR changes test takes: Time: 00:04.700, Memory: 6.00 MB

observed test & its resources usage improved & attached screenshot as well, moving to RTBC

  • nod_ committed 20f60160 on 10.3.x
    Issue #3469573 by catch, pooja_sharma: Speed up ElementTest
    
    (cherry...

  • nod_ committed 6adaeadd on 10.4.x
    Issue #3469573 by catch, pooja_sharma: Speed up ElementTest
    
    (cherry...

  • nod_ committed 1d5a6d44 on 11.0.x
    Issue #3469573 by catch, pooja_sharma: Speed up ElementTest
    
    (cherry...

  • nod_ committed 6aae9276 on 11.x
    Issue #3469573 by catch, pooja_sharma: Speed up ElementTest
    
nod_’s picture

Version: 11.x-dev » 10.3.x-dev
Status: Reviewed & tested by the community » Fixed

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!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.