Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#28 | 2979317-8.9.x-28.patch | 4.6 KB | alexpott |
#24 | 2979317-24.patch | 4.58 KB | tstoeckler |
#18 | 2979317-18--tests-only.patch | 3.32 KB | tstoeckler |
Comments
Comment #2
hchonovComment #3
hchonovThese are the patches which have to be tested manually with chrome.
Comment #5
tstoecklerI can confirm the error locally. Without the fix, the test with "Element 'Log in' not found", and it passes with the fix. How bizarre!
Comment #6
hchonovI 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.
Comment #7
hchonovComment #8
alexpottIt'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.
Comment #9
tstoecklerWow, that is very impressive! No idea why #3 makes the test pass but #8 does as well. Maybe @hchonov can confirm.
Comment #10
hchonovYes.
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?
Comment #11
tstoecklerHere'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.
Comment #13
tstoecklerAlright,
DrupalSelenium2Driver
it is, then.Comment #15
alexpottII'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.
Comment #16
tstoecklerHmm... 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.
Comment #17
tstoecklerUpdating the title and issue summary, though, now that we have proof what the problem is.
Comment #18
tstoecklerOK, here's an updated test that just asserts on the number of matching headers.
Comment #21
tstoecklerComment #22
tstoecklerComment #24
tstoecklerThis one should be green. Also fixes a stale comment.
Comment #27
cspitzlayThe 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.
Comment #28
alexpottUnfortunately this needs a reroll on supported branches (9.0.x, 8.9.x, and 8.8.x) - it needs to be fixed there.
Comment #29
alexpottCommitted 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.