Problem/Motivation
ResourceTestBase creates its own HTTP client, but inherits the default Guzzle timeout or 30 seconds. This does not use the fix from #2784159: Remove CURL timeout in BTB, which allowed us to close the critical #2844509: Random fails in BrowserTestBase tests with Operation timed out after 30001 milliseconds with 0 bytes.
This has causes occasional random failures; see https://www.drupal.org/pift-ci-job/637415
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #28 | interdiff-23-28.txt | 3.08 KB | Anonymous (not verified) |
| #28 | 2866056-28.patch | 2.43 KB | Anonymous (not verified) |
| #23 | interdiff-19-23.txt | 2.06 KB | Anonymous (not verified) |
| #23 | 2866056-23.patch | 5.51 KB | Anonymous (not verified) |
| #19 | interdiff-14-19.txt | 1.99 KB | Anonymous (not verified) |
Comments
Comment #2
mpdonadioComment #3
Anonymous (not verified) commentedI don't know we need or not need test for prevent regresion this change, because we haven't test for #2784159: Remove CURL timeout in BTB. But if need, this patch doing it. Interdiff with #2 is test-only patch.
Comment #5
mpdonadio#3 is green, so this is Needs Review (the test-only patch was second).
Comment #6
dawehnerCouldn't this get the HTTP client from the mink instance, which is somewhere in
$this->getSession()->client->getClient()or so ...Comment #7
Anonymous (not verified) commentedGood question. I found two difference in
httpClientbetweenminkandResourceTestBaseinstance:'verify' => FALSE, but maybe ResourceTestBase also not need verify internal resourses.'base_uri', but maybe we can do it by manual.But I'm not sure about these assumptions :)
Comment #9
wim leersUhm… wow.
So this is the alternative for not setting
base_urion the Guzzle HTTP client apparently. Wow.Let's at least document it.
Also…
::resolve()expects the base URL second, not first! So AFAICT this can't work.I don't think this test is very useful…?
Comment #10
wim leersAlso, I don't see how this is critical?
Comment #11
mpdonadio#10, this is causing intermittent failures, which have been classed as criticals b/c disruption to the testing system.
Comment #12
wim leersWait, what?!
The IS in #2784159: Remove CURL timeout in BTB says:
It does not mention random failures. If it was, it'd have been critical too!
I'm confused :(
Comment #13
mpdonadioAdded in some more related issues that show the history.
Looks like, we made #2784159: Remove CURL timeout in BTB to account for debugging tests.
In #2844509: Random fails in BrowserTestBase tests with Operation timed out after 30001 milliseconds with 0 bytes we finally figured out the 0 byte intermittent was cause by the 30 sec CURL timeout, and we already had an issue about that.
The patch on the first issue got in, and we just closed out the second issue.
I have seen this new issue cause a random failure, https://www.drupal.org/pift-ci-job/637415
Comment #14
Anonymous (not verified) commented#9: document it is not easy for me, but i just tried copy part of
/vendor/guzzlehttp/guzzle/src/Client.php buildUri(). ResourceTestBaseTest created only to check'timeout' => NULL,option.Retest #7 show 8 errors via use raw
$this->httpClientintestPatchDxForSecuritySensitiveBaseFields. Can we replace this case?Comment #15
wim leersThanks for doing that issue queue archeology! Confirming critical status then.
Thanks, that then explicitly confirms this is not just theoretical. Further confirmation of criticalness.
Comment #16
dawehnerI don't get why we don't force the
$urlto be absolute. I assume that we then no longer have to do this dance here?Can't you use
assertLessThan?Comment #17
wim leers#16.1: the original intent was for us to be able to do
$this->httpClient->request('/node/5?_format=json')for example. Because that'd improve legibility of the tests. But I think we're already generating absolute URLs everywhere. So perhaps we can just remove this support for relative URLs altogether. IOW: +1 :)Comment #18
dawehnerIf we want to support such things we would ideally change the central guzzle client. I believe for now its a more important to fix the critical issue, right?
Comment #19
Anonymous (not verified) commentedComment #20
dawehnerThank you!
Comment #21
anavarrecurl => cURL
Can be fixed on commit.
Comment #22
wim leers#18: absolutely! That's what I implied in #17, didn't I? :)
I wanted to confirm RTBC, but I found something small yet questionable:
So here we're removing
$this->httpClient…Then why don't we do the same here?
Then we could simply delete these lines altogether!
Comment #23
Anonymous (not verified) commentedMany thanks for the tips! Did I understand correctly about
httpClientdeletion?Comment #24
Anonymous (not verified) commentedComment #25
wim leersYep!
Reduced API surface. Less chance of breaking contrib/custom tests.
Comment #26
alexpottI don't think we should be adding this test in this issue. If the main test http client has a timeout of 30 secs then we'd have way more test fails. The fault here was creating a new client in ResourceTestBase - swapping to use the main test http client is the fix.
Comment #27
alexpottRe #26 - it is great that you've proved the fix in this issue.
Comment #28
Anonymous (not verified) commentedFor clarity, I'm not a fan of this test too. Because it more clogs, than improves the module. So no problem :)
Comment #29
dawehnerBack to RTBC
Comment #30
alexpottCommitted and pushed 3e20814 to 8.4.x and f72d600 to 8.3.x. Thanks!
Comment #33
wim leersI already raised my concerns about this test in #9.2, I'm glad it was not committed :)
Glad to have this in!
Comment #34
xjm