Problem/Motivation

When Javascript tests visit pages that generate a lot of deprecation messages (~1000) Chromedriver breaks because deprecation messages are communicated as response headers and Chromedriver cannot handle that many headers.

Proposed resolution

Because usually what happens is that code somewhere deep in the stack is run over and over again on a request a lot of the deprecation messages are identical, which is not very useful. So by simply deduplicating the messages we can fix this error.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hchonov created an issue. See original summary.

hchonov’s picture

Issue summary: View changes
hchonov’s picture

These are the patches which have to be tested manually with chrome.

The last submitted patch, 3: 2979317-3-FAIL-with-chrome.patch, failed testing. View results

tstoeckler’s picture

I can confirm the error locally. Without the fix, the test with "Element 'Log in' not found", and it passes with the fix. How bizarre!

hchonov’s picture

I wasn't able of retrieving any error messages anywhere ... I've looked into the Apache access und error logs, selenium server log, PHP error log, mariaDB error log and in syslog as well. There isn't a single clue of what is happening.

hchonov’s picture

alexpott’s picture

+++ b/core/modules/user/tests/src/FunctionalJavascript/UserLoginTest.php
@@ -0,0 +1,37 @@
+  /**
+   * {@inheritdoc}
+   */
+  protected $profile = 'standard';

It's important that it is the standard profile right? I'm pretty sure that this is because of how we communicate deprecation messages using browser headers.

tstoeckler’s picture

Wow, that is very impressive! No idea why #3 makes the test pass but #8 does as well. Maybe @hchonov can confirm.

hchonov’s picture

It's important that it is the standard profile right?

Yes.

Wow, that is very impressive!

I am impressed as well!

I confirm, that this fixes the test fails.

@alexpott, could your elaborate on how it comes to this? What is the difference between the standard and the testing profile regarding this fix? Also why does it happen only if we create a non-admin user without any permissions?
Can we probably think of a more direct approach to test this?

tstoeckler’s picture

Here's a simpler test that fails with Chromedriver for me. Creating just 100 deprecation messages passed, so I went with 1000 didn't dig any further on what number specifically is required to trigger a fail, but even with 1000 it was fast enough locally that I don't think we have to worry about it too much. Don't have PhantomJS locally, so curious what the Testbot will say. If the "tests-only" patch passes, we will have to explicitly override the Mink driver class for now until #2942900: Convert JavascriptTestBase Tests to use DrupalSelenium2Driver lands.

Status: Needs review » Needs work

The last submitted patch, 11: 2979317-10.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

tstoeckler’s picture

Status: Needs work » Needs review
FileSize
2.83 KB
4.09 KB

Alright, DrupalSelenium2Driver it is, then.

The last submitted patch, 13: 2979317-13--tests-only.patch, failed testing. View results

alexpott’s picture

Status: Needs review » Needs work

II'm not sure about the test - because it might pass if chromedriver suddenly supported more header messages - or if you swap out chromedriver for geckodriver or selenium. I think maybe we should think about the approach. I.e. should we change the communication away from headers and use a file. Or should we change the test to test on the number of deprecation messages and assert that they cannot be duplicated.

tstoeckler’s picture

Hmm... I'm fine with updating the test to assert on the number of assertion messages.

If we want to pursue using a file instead, I have no problem with that in general, but then it would be nice to get this in without a test first, because it is causing problems for us.

tstoeckler’s picture

Title: SymfonyYaml::PARSE_KEYS_AS_STRINGS is causing strange test fails and timeouts » Duplicate deprecation header messages break Chromedriver
Issue summary: View changes

Updating the title and issue summary, though, now that we have proof what the problem is.

tstoeckler’s picture

OK, here's an updated test that just asserts on the number of matching headers.

The last submitted patch, 18: 2979317-18--tests-only.patch, failed testing. View results

Status: Needs review » Needs work

The last submitted patch, 18: 2979317-18.patch, failed testing. View results

tstoeckler’s picture

Version: 8.5.x-dev » 8.6.x-dev
tstoeckler’s picture

Status: Needs work » Needs review

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

tstoeckler’s picture

This one should be green. Also fixes a stale comment.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

cspitzlay’s picture

Status: Needs review » Reviewed & tested by the community

The counting of headers has been implemented by tstoeckler as announced. Looks good to me.
We've been running our custom tests with #24 for some time already.

alexpott’s picture

Unfortunately this needs a reroll on supported branches (9.0.x, 8.9.x, and 8.8.x) - it needs to be fixed there.

alexpott’s picture

Version: 8.9.x-dev » 8.8.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed de3bb2cc24 to 9.0.x and faeb170e9f to 8.9.x and 44873f2d1e to 8.8.x. Thanks!

Backported to 8.8.x as a test only bug fix.

  • alexpott committed de3bb2c on 9.0.x
    Issue #2979317 by tstoeckler, hchonov, alexpott: Duplicate deprecation...

  • alexpott committed faeb170 on 8.9.x
    Issue #2979317 by tstoeckler, hchonov, alexpott: Duplicate deprecation...

  • alexpott committed 44873f2 on 8.8.x
    Issue #2979317 by tstoeckler, hchonov, alexpott: Duplicate deprecation...

Status: Fixed » Closed (fixed)

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