-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
Ferrum 0.15.0 causes crash in CI and test suite collapse #470
Comments
As an additional note, should it be useful, we can fork the gem, revert any changes that might be suspected of causing the problem and run CI on a branch of our main code base that's using our forked Ferrum copy. |
We've had a very similar experience. We have a large test suite and use custom GitHub action runners on AWS EC2 instances to run headless tests. We see ~4/10 runs fail, typically with something like
We suspect something in Ferrum is causing the issue, we're finding it difficult to replicate locally. We have also tried pinning Ferrum to the latest master commit but see the same failures |
Can you try setting |
@route We've had two full successful CI runs on Cuprite 0.15.1 / Ferrum 0.15.0 using This suggests that perhaps |
Four passes now, so I'm confident that |
We're also seeing a much better success rate with the Should this setting be a recommendation, if running under certain conditions? |
That’s only to triage the issue for now. They should work the absolutely the same way, so I’m not sure where the issue lies for now. |
I'll be back at work next week, please bear with me. Meanwhile any debug logs would be appreciated. |
@route just to confirm, setting the |
@dgholz yes, they gonna be in the output |
Logs for comparison@route, on behalf of @dgholz, here's the CDP logs. It looks like we're failing on the first command in Lines 432 to 434 in 5ca5e9e
It keeps trying to get a response until it eventually hits the timeout: CDP logs for a failure to `prepare_page`
When it's successful, it gets a response quickly from the CDP logs for a run that successfully `prepare_page`
Also worth noting that when the error occurs, it looks to be the first feature spec that the node is running, rather than having ran a few specs then starting to fail. We saw a huge spike in failures with the latest vesion of Chrome v127, and subsequently had to roll back to using v126 in our actions, otherwise we have a failure rate of about 25%. Please let me know if there's anything else we can share in terms of debugging, to make it clearer where the bug is. |
Describe the bug
I'm not sure how to supply a useful bug report here given the bizarre behaviour but - we have a large RSpec test suite including lots of headless Chrome tests that run on AWS CI (CodeBuild / CodePipeline) triggered off GitHub commits. Recently, we updated our bundle which took Cuprite from 0.15.0 to 0.15.1; this in turn requires Ferrum 0.15.0. Our test suite started failing spectacularly, but intermittently (maybe a 70% failure rate, at arbitrary points in the suite, apparently regardless of seed). I'll explain more elsewhere in the template since this section is meant to be "brief" - we see this:
Part of Ferrum appears to then have crashed, or the Chrome instance has, because all subsequent tests fail with:
To Reproduce
This is the problem; it replicates easily in AWS CI but we can't reproduce it locally. It seems that a
TimeoutError
comes fromclient.rb
line 90, exactly as it does if I were to, say, deliberately set thetimeout
option to something very low. When I do this on local machine or in CI in an attempt to provoke replication, I just see things failing "as expected" with:In case it is important - we do then notice that after a few hundred failures like this, suddenly the message changes and subsequent tests say:
I do not know if this is important or just an unrelated minor bug arising from setting timeout so low and Ferrum perhaps not closing down old Chromium instances if its comms time out too soon, since it occurs when we were trying but failing to replicate the nasty crash error.
We have yet to persuade localhost to show the unhandled exception that crashes something out badly, with the "canary" error seen in CI of:
Since this comes from the same piece of code, it's hard to see how it could arise in such different ways unless perhaps the code paths used to reach this part of
client.rb
are very different in each case and one is missing an exception handler.Expected behavior
I would not expect timeouts at all. The suite should run normally. It does with Ferrum 0.14.0 and has for many years with that and prior versions. 0.15.0 introduces the new behaviour. We've pinned to Cuprite 0.15.0 / Ferrum 0.14.0 for now, and CI is working as usual.
If a timeout for real did happen, then I'd expect it to be handled i the usual way:
...rather than a thread termination.
Screenshots
It doesn't really help much but to prove we're not making it up 😂 here's an AWS CI screenshot from the point where things break.
Desktop (please complete the following information):
Additional context
Note that we don't think this is Cuprite, but since Cuprite 0.15.0 only works with Ferrum 0.14.0 and not 0.15.0 and, conversely, Cuprite 0.15.1 only works with Ferrum 0.15.0 and 0.14.0, we can only upgrade or downgrade those two gems in lockstep. I couldn't see anything in Cuprite's
CHANGELOG.md
that looked like it might be a cause, but quickly saw in Ferrum's (excellent, detailed)CHANGELOG.md
some potential causes, yet these could be red herrings. All of them are in one big PR: #432 - a large change set related to comms, threading and exceptions.There is a WebSocket constraint change, but WebSocket was and is still on 0.7 (latest) and works fine, so this is not involved.
The text was updated successfully, but these errors were encountered: