You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I experienced some random Ferrum::TimeoutError when calling wait_for_idle. For the same navigation, sometime it would fail, sometime it would pass.
After adding debug information output for requestWillBeSent, responseReceived, loadingFinished and loadingFailed events, it looks like some request can be sent while navigating to another page, and never receive a responseReceived, loadingFinished, or loadingFailed event.
For instance:
requestWillBeSent for requestId=349E42C73C6810F5DBFA790494E57AE0 loaderId=349E42C73C6810F5DBFA790494E57AE0 at 73687.356628
requestWillBeSent for requestId=429934.40 loaderId=8FCB3DE497DC83193F1D76075900D0D4 at 73687.362944
requestWillBeSent for requestId=429934.41 loaderId=8FCB3DE497DC83193F1D76075900D0D4 at 73687.452702
responseReceived for requestId=349E42C73C6810F5DBFA790494E57AE0 loaderId=349E42C73C6810F5DBFA790494E57AE0 at 73687.54549
The two requests 429934.40 and 429934.41 are in the @traffic array, but no responseReceived, loadingFinished, or loadingFailed event will be sent for them, so they will still be considered pending. They have a different loaderId because they have been loaded by the previous page doing some asynchronous XHR request for some reason.
When wait_for_idle is called, it will wait for all pending request to finish, even those from no-more displayed pages, making it fail with Ferrum::TimeoutError.
I modified the #pending_connections method a little to consider only pending connections for the current page. I looks somewhat like this:
I experienced some random
Ferrum::TimeoutError
when callingwait_for_idle
. For the same navigation, sometime it would fail, sometime it would pass.After adding debug information output for
requestWillBeSent
,responseReceived
,loadingFinished
andloadingFailed
events, it looks like some request can be sent while navigating to another page, and never receive aresponseReceived
,loadingFinished
, orloadingFailed
event.For instance:
The two requests
429934.40
and429934.41
are in the@traffic
array, but noresponseReceived
,loadingFinished
, orloadingFailed
event will be sent for them, so they will still be considered pending. They have a differentloaderId
because they have been loaded by the previous page doing some asynchronous XHR request for some reason.When
wait_for_idle
is called, it will wait for all pending request to finish, even those from no-more displayed pages, making it fail withFerrum::TimeoutError
.I modified the
#pending_connections
method a little to consider only pending connections for the current page. I looks somewhat like this:This fixes my issue.
I am no expert in CDP. Maybe there are some other events that I missed. Is this approach correct?
Chrome version is 119.0.6045.105 on Linux amd64.
The text was updated successfully, but these errors were encountered: