diff --git a/src/EditorFeatures/Test/SolutionCrawler/WorkCoordinatorTests.cs b/src/EditorFeatures/Test/SolutionCrawler/WorkCoordinatorTests.cs index 4d9d9206156f2408a655db81b3ee1c1272a4c79d..77491fd5b8631bbd4a9bd0a500082d1fa9df8a24 100644 --- a/src/EditorFeatures/Test/SolutionCrawler/WorkCoordinatorTests.cs +++ b/src/EditorFeatures/Test/SolutionCrawler/WorkCoordinatorTests.cs @@ -23,7 +23,7 @@ public class WorkCoordinatorTests private const string SolutionCrawler = nameof(SolutionCrawler); [Fact] - public void RegisterService() + public async Task RegisterService() { using (var workspace = new WorkCoordinatorWorkspace(SolutionCrawler)) { @@ -34,6 +34,11 @@ public void RegisterService() // register and unregister workspace to the service registrationService.Register(workspace); registrationService.Unregister(workspace); + + // make sure we wait for all waiter. the test wrongly assumed there won't be + // any pending async event which is implementation detail when creating workspace + // and changing options. + await WaitWaiterAsync(workspace.ExportProvider); } }