[Components][Fixes #7405] Increase CanTriggerEventHandlerDisposedInEarlierPendingBatchAsync timeout to reduce test flakyness
Increases the timeout from 500 to 1000
This commit is contained in:
parent
bbe4a9d071
commit
4fe4295720
|
|
@ -2566,8 +2566,15 @@ namespace Microsoft.AspNetCore.Components.Test
|
|||
|
||||
// Act/Assert 3: After we complete the first UI update in which a given
|
||||
// event handler ID is disposed, we can no longer reuse that event handler ID
|
||||
|
||||
// From here we can't see when the async disposal is completed. Just give it plenty of time (Task.Yield isn't enough).
|
||||
// There is a small chance in which the continuations from TaskCompletionSource run asynchronously.
|
||||
// In that case we might not be able to see the results from RemoveEventHandlerIds as they might run asynchronously.
|
||||
// For that case, we are going to queue a continuation on render1TCS.Task, include a 1s delay and await the resulting
|
||||
// task to offer the best chance that we get to see the error in all cases.
|
||||
var awaitableTask = render1TCS.Task.ContinueWith(_ => Task.Delay(1000)).Unwrap();
|
||||
render1TCS.SetResult(null);
|
||||
await Task.Delay(500); // From here we can't see when the async disposal is completed. Just give it plenty of time (Task.Yield isn't enough).
|
||||
await awaitableTask;
|
||||
var ex = await Assert.ThrowsAsync<ArgumentException>(() =>
|
||||
{
|
||||
return renderer.DispatchEventAsync(eventHandlerId, new UIEventArgs());
|
||||
|
|
|
|||
Loading…
Reference in New Issue