rubycdp / ferrum

Headless Chrome Ruby API
https://ferrum.rubycdp.com
MIT License
1.7k stars 122 forks source link

Websocket connection remains indefinitely in `:connecting` state and causes `TimeoutError` #329

Closed francisbeaudoin closed 1 year ago

francisbeaudoin commented 1 year ago

Issue

Within a test run, we're intermittently get a TimeoutError.

Root cause

It is caused by the Websocket that remains in a :connecting state - that behavior is also discussed in https://github.com/rubycdp/cuprite/pull/36

Proposed fix

By bumping the sleep to 0.05 we're no longer getting the issue but that is probably not ideal. In full transparency, I haven't tried any lower sleep time as I think the performance hit is fine.