[random test failure] Toolbar Test (toolbarTest.js)

Created on 29 April 2025, 3 days ago

Problem/Motivation

Nightwatch test is flakey. For some reason nightwatch is not able to press the confirm button to install the toolbar module.

│   ✖ NightwatchAssertError                                                                                                                                                                                  │
│      Timed out while waiting for element <#system-modules-confirm-form, #system-modules-non-stable-confirm-form> to be present for 10000 milliseconds. - expected "found" but got: "not found" (10446ms)   │
│                                                                                                                                                                                                            │
│       Error location:                                                                                                                                                                                      │
│       /builds/project/drupal/core/tests/Drupal/Nightwatch/Commands/drupalInstallModule.js:30                                                                                                               │
│       –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––                                                                                                                │
│        28 |     if (force) {                                                                                                                                                                               │
│        29 |       // Click `Continue` if applicable.                                                                                                                                                       │
│        30 |       this.waitForElementPresent(                                                                                                                                                              │
│        31 |         '#system-modules-confirm-form, #system-modules-non-stable-confirm-form',                                                                                                               │
│        32 |         10000,                                                                                                                                                                                 │
│       –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––    

Steps to reproduce

https://git.drupalcode.org/project/drupal/-/jobs/5054046/viewer
https://git.drupalcode.org/project/drupal/-/jobs/5011069/viewer

Proposed resolution

Not sure, but ideally we can install modules in tests without clicking buttons in the UI

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

11.0 🔥

Component

toolbar.module

Created by

🇦🇺Australia mstrelan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @mstrelan
  • Merge request !11985Resolve #3521639 "Toolbar test" → (Open) created by mstrelan
  • Pipeline finished with Failed
    2 days ago
    Total: 326s
    #485374
  • 🇦🇺Australia mstrelan

    Not sure how to reproduce this one, but if the failing part doesn't exist then it can't fail, right?

    I had a go at using the setupFile arg to provide the setup required for the test. Before doing this, the nightwatch test would complete in around 26 seconds, performing 11 HTTP requests before getting to the login step. Once I moved the module and permission setup to a setup file this was reduced to around 16 seconds, with 1 HTTP request before the login. But to use ::createUser I had to borrow a few assert methods from phpunit, and I figured we could just assign the perms to anonymous user. This eliminated all initial HTTP requests. I then noticed there were several permissions that were not required for the test to pass, so I removed those as well.

    I guess this should be postponed on Provide PHP helpers for Nightwatch tests to speed up routine operations Active , but if it helps with the current random fails maybe we can keep it as it is until we have some generic helpers.

  • Pipeline finished with Success
    2 days ago
    Total: 1468s
    #485378
  • 🇺🇸United States smustgrave

    Seems pretty straight forward, only part I second guess was changing from a random role to anonymous. But frankly nightwatch is more pain then value I believe so say why not.

Production build 0.71.5 2024