Avoid random failures in JavascriptTestBase when testing functionality in a dialog

Created on 26 February 2017, over 7 years ago
Updated 14 March 2023, over 1 year ago

Problem/Motivation

As discoverd in #2832672: [PP-1] Upgrade jcalderonzumba/* for better test performance ā†’ a test opening a dialog and then peforming actions within the opened dialog are at risk for random failure.

The random failure is caused by a dialog resize/reposition after content has been inserted. Currently there is no way to wait for this as this behavior is debounced.

Currently the random failures do not occur because the Mink Phantomjs driver waits an additional 100ms on each wait statement. However on upgrading the driver or switching to another driver ( #2775653: JavascriptTests with webDriver ā†’ ) this problem will become relevant.

Proposed resolution

Either:
1. Provide a better way to assert the dialog has opened.
2. Remove the random failure factor for opening a dialog.

Steps to reproduce:

This issue improves the way we wait for a dialog to open. The reason is random failure and therefore difficult to reproduce.

To reproduce the random fail do the following:
- Apply the patch from #2832672: [PP-1] Upgrade jcalderonzumba/* for better test performance ā†’ , this will make the random fail occur more often.
- Do not apply the patch from this issue.
- Run the test in views_ui/tests/src/FunctionalJavascript/FilterCriteriaTest.php multiple times untill the test fails.
- See the excellent research in #2832672: [PP-1] Upgrade jcalderonzumba/* for better test performance ā†’ by @tacituseu to see an explaination on the fails.

I have run the tests on multiple 25x runs locally and I got the fails frequently before applying this patch and no more after applying this patch.

Thanks @michielnugter for the patch. And tacituseu & droplet did a lot of researching on #2832672: [PP-1] Upgrade jcalderonzumba/* for better test performance ā†’ . Please credit them also if we can.

šŸ› Bug report
Status

Needs review

Version

10.1 āœØ

Component
PHPUnitĀ  ā†’

Last updated about 10 hours ago

Created by

šŸ‡³šŸ‡±Netherlands michielnugter

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024