Problem/Motivation

The 9.4.x test fails a very simple patch which removes one line of CSS in #3212792: In ui-dialog box at Views button hover effect is odd ... So it looks like the general PHPUnit test for 9.4.x needs to be adjusted?

Drupal\Tests\field_layout\FunctionalJavascript\FieldLayoutTest

exception: [Other] Line 0 of sites/default/files/simpletest/phpunit-47.xml:
PHPUnit Test failed to complete; Error: PHPUnit 9.5.10 by Sebastian Bergmann and contributors.

Warning:       Your XML configuration validates against a deprecated schema.
Suggestion:    Migrate your XML configuration using "--migrate-configuration"!

Testing Drupal\Tests\field_layout\FunctionalJavascript\FieldLayoutTest
....E                                                               5 / 5 (100%)

Time: 01:24.565, Memory: 4.00 MB

There was 1 error:

1) Drupal\Tests\field_layout\FunctionalJavascript\FieldLayoutTest::testChangingFormatterAndRegion
WebDriver\Exception\CurlExec: Curl error thrown for http POST to http://chromedriver-jenkins-drupal-patches-103172:9515/session/d96a15e0f0fd99452725bbc699b34a19/execute with params: {"script":"(function (element) {\n    var event = document.createEvent(\"HTMLEvents\");\n\n    event.initEvent(\"drop\", true, true);\n    event.dataTransfer = {};\n\n    element.dispatchEvent(event);\n}(arguments[0]));","args":[{"ELEMENT":"0.30593010467280135-2"}]}

Retries: 10 and last result:
{"sessionId":"d96a15e0f0fd99452725bbc699b34a19","status":10,"value":{"message":"stale element reference: element is not attached to the page document\n  (Session info: headless chrome=74.0.3729.157)\n  (Driver info: chromedriver=2.38.552522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb),platform=Linux 4.9.0-0.bpo.6-amd64 x86_64)"}}

/var/www/html/vendor/instaclick/php-webdriver/lib/WebDriver/Exception.php:156
/var/www/html/core/tests/Drupal/FunctionalJavascriptTests/WebDriverCurlService.php:146
/var/www/html/vendor/instaclick/php-webdriver/lib/WebDriver/AbstractWebDriver.php:123
/var/www/html/vendor/instaclick/php-webdriver/lib/WebDriver/AbstractWebDriver.php:245
/var/www/html/vendor/instaclick/php-webdriver/lib/WebDriver/Container.php:239
/var/www/html/vendor/behat/mink-selenium2-driver/src/Selenium2Driver.php:289
/var/www/html/vendor/behat/mink-selenium2-driver/src/Selenium2Driver.php:949
/var/www/html/vendor/behat/mink/src/Element/NodeElement.php:289
/var/www/html/core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php:261
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:722

ERRORS!
Tests: 5, Assertions: 44, Errors: 1.

HTML output was generated
http://php-apache-jenkins-drupal-patches-103172/subdirectory/sites/simpletest/browser_output/Drupal_Tests_field_layout_FunctionalJavascript_FieldLayoutTest-1-65213040.html
[...]
http://php-apache-jenkins-drupal-patches-103172/subdirectory/sites/simpletest/browser_output/Drupal_Tests_field_layout_FunctionalJavascript_FieldLayoutTest-51-10306520.html

	✗	
Unknown

fail: [run-tests.sh check] Line 0 of :
FATAL Drupal\Tests\field_layout\FunctionalJavascript\FieldLayoutTest: test runner returned a non-zero error code (2).

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

ressa created an issue. See original summary.

ressa’s picture

Issue summary: View changes

Adding test error message.

cilefen’s picture

Why is this titled "Your XML configuration validates against a deprecated schema"? That is a warning. It is not the reason the test failed.

The test failure is "stale element reference: element is not attached to the page document". That seems like something that could occur based on CSS changes.

I do not understand this issue. Is this about the test failure or the XML schema deprecation warning?

cilefen’s picture

ressa’s picture

Status: Active » Closed (works as designed)

I gave it that name because I thought that was the problem. Feel free to correct the title.

@longwave explained in the #3212792: In ui-dialog box at Views button hover effect is odd issue:

Triggered a retest on 9.4.x, sometimes we see random failures in the JavaScript tests that go away when the test is rerun.
The PHPUnit warning is unrelated, we can't upgrade until we drop support for PHPUnit 8.

In the issue, you will find a patch which removes a single line:
font-weight: normal/*{fwDefault}*/;
Do you think that could trigger the error? The patch passed with 9.3.x, so that's why I assumed the issue was with the test set-up.

cilefen’s picture

If you mean "Your XML configuration validates against a deprecated schema", that's just PHPUnit complaining that phpunit.xml needs updating.

ressa’s picture

Title: PHPUnit fails: Your XML configuration validates against a deprecated schema » [random test failure] FieldLayoutTest: stale element reference: element is not attached to the page document
Component: phpunit » field_layout.module
Status: Closed (works as designed) » Closed (duplicate)
Related issues: +#2829040: [meta] Known intermittent, random, and environment-specific test failures, +#3212792: In ui-dialog box at Views button hover effect is odd, +#3099427: [random test failure] FieldLayoutTest::testEntityView()

Thanks. The re-test triggered by @longwave passed, so it looks like a random JavaScript test failure.

In a similar issue (#3099427: [random test failure] FieldLayoutTest::testEntityView()) @catch explains a possible solution:

Unfortunately #3211164: Random errors in Javascript Testing will not fix this. What we need to work out is why the $second_region_row has been removed or replaced on the page. What possible triggers are there for that and if maybe we could use a different destination that cannot possibly be removed.