From 6355f990cf20a77b6c0cc41019345546e7511e91 Mon Sep 17 00:00:00 2001 From: Leonardo Fernandes Date: Wed, 14 Jun 2023 21:33:54 +1000 Subject: [PATCH] Fix PageGotoTests' flakyness. See https://github.com/puppeteer/puppeteer/pull/8717 --- lib/PuppeteerSharp/LifecycleWatcher.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/PuppeteerSharp/LifecycleWatcher.cs b/lib/PuppeteerSharp/LifecycleWatcher.cs index f601657e4..f63f591f2 100644 --- a/lib/PuppeteerSharp/LifecycleWatcher.cs +++ b/lib/PuppeteerSharp/LifecycleWatcher.cs @@ -35,7 +35,6 @@ internal sealed class LifecycleWatcher : IDisposable private IRequest _navigationRequest; private bool _hasSameDocumentNavigation; private bool _swapped; - private bool _newDocumentNavigation; public LifecycleWatcher( FrameManager frameManager, @@ -99,7 +98,6 @@ private void Navigated(object sender, FrameEventArgs e) return; } - _newDocumentNavigation = true; CheckLifecycleComplete(); } @@ -143,7 +141,7 @@ private void CheckLifecycleComplete() _sameDocumentNavigationTaskWrapper.TrySetResult(true); } - if (_swapped || _newDocumentNavigation) + if (_swapped || _frame.LoaderId != _initialLoaderId) { _newDocumentNavigationTaskWrapper.TrySetResult(true); }