Skip to content

Commit

Permalink
It was possible for the TargetManager initialization to finish withou…
Browse files Browse the repository at this point in the history
…t having discovered all targets.

This was causing unit tests such as PuppeteerConnectTests.ShouldSupportTargetFilter to fail because the test executed faster than the target discovery.
  • Loading branch information
leonardo-fernandes committed Jun 2, 2023
1 parent deb351d commit 84c3dd5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/PuppeteerSharp/ChromeTargetManager.cs
Expand Up @@ -93,7 +93,9 @@ await _connection.SendAsync("Target.setAutoAttach", new TargetSetAutoAttachReque
AutoAttach = true,
}).ConfigureAwait(false);

await _targetDiscoveryCompletionSource.Task.ConfigureAwait(false);
FinishInitializationIfReady();

await _initializeCompletionSource.Task.ConfigureAwait(false);
}

Expand Down

0 comments on commit 84c3dd5

Please sign in to comment.