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
Looking into issue #82 I noticed that when changing targets, zendriver won't properly wait for chrome to return the response events.
Browser._handle_target_update handles the TargetInfoChanged, TargetCreated and TargetDestroyed events in the background (given that config.autodiscover_targets is enabled). However, when calling Tab.close, for example, it will only call the cdp.target.close_target method without waiting for any response. For subsequent actions, zendriver will now choose the old, now destroyed target as the connection, which will cause an infinite wait for a response.
It seems that the original author tried to circumvent this issue by adding hard-coded sleep in certain areas, for example in Browser.get, but not in all places where the target may be changed. For obvious reasons, this is not an ideal solution, but adding a sleep to all of these methods may be a viable band-aid fix for this issue.
I think that this is a flaw in zendriver. Ideally, target changes should always be awaited for.
(Remember that enabling debug logs will delay the process enough for the issue to disappear. I was able to easily reproduce this with the code snippet provided in #82)
The text was updated successfully, but these errors were encountered:
Looking into issue #82 I noticed that when changing targets, zendriver won't properly wait for chrome to return the response events.
Browser._handle_target_update
handles theTargetInfoChanged
,TargetCreated
andTargetDestroyed
events in the background (given thatconfig.autodiscover_targets
is enabled). However, when callingTab.close
, for example, it will only call thecdp.target.close_target
method without waiting for any response. For subsequent actions, zendriver will now choose the old, now destroyed target as the connection, which will cause an infinite wait for a response.It seems that the original author tried to circumvent this issue by adding hard-coded sleep in certain areas, for example in Browser.get, but not in all places where the target may be changed. For obvious reasons, this is not an ideal solution, but adding a sleep to all of these methods may be a viable band-aid fix for this issue.
I think that this is a flaw in zendriver. Ideally, target changes should always be awaited for.
(Remember that enabling debug logs will delay the process enough for the issue to disappear. I was able to easily reproduce this with the code snippet provided in #82)
The text was updated successfully, but these errors were encountered: