Problem/Motivation
#2919373: Prevent Settings Tray functionality for blocks that have configuration overrides introduced a test that introduced test failures on PHP 5 & PostgreSQL 9.1/SQLite 3.8:
https://www.drupal.org/pift-ci-job/864394
https://www.drupal.org/pift-ci-job/864395
https://www.drupal.org/pift-ci-job/865205
https://www.drupal.org/pift-ci-job/866984
https://www.drupal.org/pift-ci-job/866991
These failures are actually coming from Quick Edit ajax calls. Probably no other test actually is having these
Drupal\Tests\settings_tray\FunctionalJavascript\SettingsTrayBlockFormTest::testOverriddenConfigurationRemoved
Zumba\GastonJS\Exception\JavascriptError: One or more errors were raised in the Javascript code on the page.
If you don't care about these errors, you can ignore them by
setting js_errors: false in your Poltergeist configuration (see documentation for details).
AjaxError:
An AJAX HTTP request terminated abnormally.
Debugging information follows.
Path: /subdirectory/quickedit/attachments
StatusText: error
ResponseText:
ReadyState: 0
AjaxError:
An AJAX HTTP request terminated abnormally.
Debugging information follows.
Path: /subdirectory/quickedit/attachments
StatusText: error
ResponseText:
ReadyState: 0
at http://php-apache-jenkins-php5-5-postgres9-1-2809/subdirectory/core/misc... in error
at http://php-apache-jenkins-php5-5-postgres9-1-2809/subdirectory/core/misc... in complete
at http://php-apache-jenkins-php5-5-postgres9-1-2809/subdirectory/core/asse... in i
at http://php-apache-jenkins-php5-5-postgres9-1-2809/subdirectory/core/asse... in fireWith
at http://php-apache-jenkins-php5-5-postgres9-1-2809/subdirectory/core/asse... in A
at http://php-apache-jenkins-php5-5-postgres9-1-2809/subdirectory/core/asse...
at :0 in openUrl
at phantomjs://platform/webpage.js:281 in open
at phantomjs://code/web_page.js:71
at phantomjs://code/browser.js:202 in visit
at phantomjs://code/browser.js:1272 in serverRunCommand
at phantomjs://code/poltergeist.js:38 in serverRunCommand
at phantomjs://code/server.js:76 in handleRequest
at phantomjs://code/server.js:22/var/www/html/vendor/jcalderonzumba/gastonjs/src/Browser/BrowserBase.php:119
/var/www/html/vendor/jcalderonzumba/gastonjs/src/Browser/BrowserBase.php:99
/var/www/html/vendor/jcalderonzumba/gastonjs/src/Browser/BrowserNavigateTrait.php:19
/var/www/html/vendor/jcalderonzumba/mink-phantomjs-driver/src/NavigationTrait.php:15
/var/www/html/vendor/behat/mink/src/Session.php:148
/var/www/html/core/tests/Drupal/Tests/BrowserTestBase.php:682
/var/www/html/core/modules/system/tests/src/FunctionalJavascript/OffCanvasTestBase.php:16
/var/www/html/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php:666FAILURES!
Tests: 26, Assertions: 733, Errors: 1.
Proposed resolution
We need to actually test Quick edit separately so that if other modules want to test with Quick Edit on they don't have to worry that there will be problems.
#2938308: Add QuickEdit Javascript tests
For now though there is no reason for Quick Edit to enabled except on \Drupal\Tests\settings_tray\FunctionalJavascript\SettingsTrayBlockFormTest::testQuickEditLinks
Remaining tasks
Write patch
Comments
Comment #2
tedbowComment #3
tedbowSo Quick edit is needed for 2 tests
\Drupal\Tests\settings_tray\FunctionalJavascript\SettingsTrayBlockFormTest::testQuickEditLinks()
\Drupal\Tests\settings_tray\FunctionalJavascript\SettingsTrayBlockFormTest::testCustomBlockLinks()
Here is a patch that enables it and grants permission just for those tests.
Adding test runs for all combos against 8.6.x but also 8.5.x test with PHP 5.5 & PostgreSQL 9.1, which specifically failed
Comment #4
Wim LeersPretty crazy that this only happens on Postgres … but:
+1 for only installing the module when necessary.
And granting the permission only when necessary.
Comment #5
tacituseu CreditAttribution: tacituseu commentedIt is the slowest environment, timing sensitive things tend to trip there first, adding another case on PHP 5.6. Might be caused by CSS animations (see: #2828528-96: Add Quick Edit Functional JS test coverage, #2901626: CSS animations cause \Drupal\Tests\outside_in\FunctionalJavascript\OutsideInBlockFormTest random fails).
Comment #6
tacituseu CreditAttribution: tacituseu commentedAlso failing on PHP 5 & SQLite 3.8
Comment #7
catchShould we split that out to a separate test class so we can put quickedit back into $modules[] just in that class?
Comment #8
tedbow@catch we could but that would involve also creating new base test class that both the existing test class and the new one would extend because the new test class would need some of the protected methods in
SettingsTrayBlockFormTest
I started the patch and at least these would need to be moved to the base test class.
It seems very disruptive to fix this random failing test.
Comment #9
tedbowre #8 I could refactor this into 2 test classes and base but I was thinking it would be much easier to review if we didn't do that.
But should I make follow up to split
SettingsTrayBlockFormTest
into multiple class because now that I look at it we have other methods liketestOverriddenBlock
andtestOverriddenConfigurationRemoved
that are the only methods that need the test modulesettings_tray_override_test
. This conceptually also might better under a new classSettingTrayConfigurationOverrideTest
Comment #10
tedbowIt think these random failures are suppose to be critical?
Comment #11
tedbowRe #9 I have created a follow up that splits the test class so other modules also don't have to be installed when they aren't needed
I have already created the patch for that issue so it isn't forgotten after this issue is committed.
@catch does that address your concerns in #3?
Comment #12
catchOK that's more than I'd anticipated, since this is critical the follow-up is a good plan.
Comment #13
tedbowHere is backport to 8.4.x. version to mitigate potential fails in testing there as well, since this is a critical.
Comment #15
tedbowsorry my 8.4.x patch kicked the issue to Needs Work
Comment #16
xjmI queued an 8.4.x run for the backport as well.
Comment #19
xjmI think this is sufficient to mitigate the high fail rate we're seeing in HEAD, given #2939814: Split SettingsTrayBlockFormTest into multiple class to only enable modules when needed as the followup. We might still see some fails on those two methods? But let's work around what we can for now.
Committed and pushed to 8.5.x. Leaving at RTBC against 8.4.x while the test run finishes.
Comment #21
xjmAnd, committed the backport to 8.4.x. Thanks!