-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support MinkSelenium2Driver page timeout #38
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #38 +/- ##
============================================
- Coverage 84.61% 84.40% -0.22%
- Complexity 194 196 +2
============================================
Files 1 1
Lines 494 500 +6
============================================
+ Hits 418 422 +4
- Misses 76 78 +2 ☔ View full report in Codecov by Sentry. |
ba4bab6
to
02da744
Compare
This comment was marked as outdated.
This comment was marked as outdated.
0599ae5
to
7c435d2
Compare
The failed builds on the https://github.com/minkphp/webdriver-classic-driver/actions/runs/11654305762 failed due cURL request to Selenium Server took too long to respond (>3 minutes). That is actually default cURL timeout. Looks like Selenium Server in a Docker container died. |
Thanks for the tries so far. The situation is very strange:
|
Very strange indeed. I've tried combo of TimeoutsTest and WindowTest and they've passed. Seems like some cumulative effect takes place (e.g. tests in between TimeoutsTest and WindowTest add up to produce super long running time). Maybe we've just added more tests and some critical limit was hit. Keep in mind, that we don't start/top Selenium Server session multiple times (e.g. Driver::start/Driver::stop), but instead do Driver::reset to close windows and clean cookies. |
It seems, that I'm getting closer. But I'm out of ideas. I've tried removing all of the added code one by one to see if the issues will be fixed (e.g. deprecation checking, setting 500ms timeout, etc.). Nothing helped so far. The problem always seems to be with
Page visiting fails:
The fact that we saw that issue while developing timeout-changing code seems like a coincidence. |
Not always, sometimes it fails after and sometimes before - I noticed that when we had the larger build matrix - but it always seems to break somewhere there, which is interesting considering the amount of other successful tests between the timeout test and the window test.
But nonetheless it has to be related to the timeout tests, right? Everything worked fine without the deprecation test I added in this PR. I noticed the GH action you added...that looks very interesting for debugging. 👍 |
You're welcome to use it. I can't proceed any further without real-time debugging with xDebug. Trying to arrange it with https://github.com/nektos/act . |
I've managed to start https://github.com/nektos/act, but all tests are passing. Seems, that issue can only reproduced in the GitHub Actions. I've also used a built-in PHP 8.3 web server and it's passing locally. Maybe I'll try to use a built-in PHP web server from a different PHP version on GitHub Actions. We had some issues with this in the past. |
@aik099 thanks for the investigation. I'll give it a look myself now. |
@aik099 I found the solution and possibly the problem, it seems to be because we do not really run headless in the workflow. After the necessary changes, the test passes without a hitch ( I copied that config from another project, the main noteworthy things is that (1) the docker service does not start xvfb (true headless), (2) the config requests that chrome is started headless and (3) config also requests chrome not to use the gpu. On a related subject, as a Behat user, this thing about properly configuring headless has always been a bit of a hassle. Even the slightly wrong config causes crashes and extremely hard to understand errors. Since this driver takes care of some defaults settings, I'm wondering if it may make sense to bake this in to make it easier for the end users. The problem is how do we pass this information ( One possible way is to pass a non-standard capability (e.g. "headless") which we then handle inside the driver. What do you think? |
@uuf6429 , since in all cases it's a timeout to the local web server (started from bootstrap.php) ocurred, then I've decided to run that web server from GitHub Actions directly. The issue I'm facing is that tests can't connect to I have no idea how to fix this. Please help. |
Hmm, I'm not sure... maybe try But in any case, check my previous message - there shouldn't be any difference in how the web server is started. Also selenium logs say that the timeout occurred when trying to control the browser to visit the fixture url, so it is not necessarily the problem of the web server (if the browser is already crashed/stuck, we will get the curl error). |
Here are my configs (in desired capabilities) for headless testing:
P.S.
|
… in the checking process
…pageLoad" timeout several times. So skip test in there as well.
b25b3b2
to
2c6a20c
Compare
Rebased on |
@aik099 hey, it seems the crash is also happening for firefox/selenium2: We could also skip this case, but the situation (combination of browser with selenium) is in general very odd. |
The Selenium2+Firefox wasn't crashing all the time it seems (see https://github.com/minkphp/webdriver-classic-driver/actions/runs/11679073840/job/32519553552). Very odd. I wonder why it's happening on GitHub Actions only with Selenium Image involved. I've tried using Act tool to run that build locally and it never failed for window tests. Anyway please add the same exclusion for the Firefox+Selenium2 case as I did for non-Firefox versions. And hopefully we can merge this long-running PR. |
@aik099 isn't that just the description? Or did you mean the commit message (that it mentions MinkSelenium2Driver)? https://github.com/minkphp/webdriver-classic-driver/commits/main/ I could also just remove the description, it's also fine by me. |
Yeah, I meant the commit message itself, which explains how we've got to the code we have, that doesn't matter anymore:
|
Fixes #36.