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
Either a WaitTaskTimeoutException if the selector isn't available, or execution to resume normally.
Actual behavior:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at System.Collections.Generic.List`1.Add(T item)
at PuppeteerSharp.WaitTask..ctor(DOMWorld world, String predicateBody, Boolean isExpression, String title, WaitForFunctionPollingOption polling, Nullable`1 pollingInterval, Int32 timeout, Object[] args)
at PuppeteerSharp.DOMWorld.<WaitForSelectorOrXPathAsync>d__43.MoveNext()--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Tasktask)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Tasktask)
at PuppeteerSharp.Frame.<WaitForSelectorAsync>d__58.MoveNext()--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Tasktask)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Tasktask)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Tasktask)
at mycode
Versions
PuppeteerSharp 2.0.4
.net Framework 4.7.2
Additional Information
From browsing the source, the only List.Add call in the WaitTask constructor is at
I stumbled upon the exact same problem. It seems like there is a problem with using a List (which is not thread-safe) in a concurrent environment and we experience a race.
Description
Occasionally and randomly (I cannot reliably reproduce this), I get an Index Out Of Range exception when calling WaitForSelectorAsync.
Complete minimal example reproducing the issue
Expected behavior:
Either a
WaitTaskTimeoutException
if the selector isn't available, or execution to resume normally.Actual behavior:
Versions
PuppeteerSharp 2.0.4
.net Framework 4.7.2
Additional Information
From browsing the source, the only List.Add call in the WaitTask constructor is at
puppeteer-sharp/lib/PuppeteerSharp/WaitTask.cs
Line 140 in 6c78425
That doesn't seem likely to throw so perhaps another race condition similar to #717 ?
The text was updated successfully, but these errors were encountered: