Skip to content

Commit

Permalink
Fix flaky diagnostic test
Browse files Browse the repository at this point in the history
  • Loading branch information
dibarbet committed Dec 2, 2024
1 parent 31ac7e2 commit b5f57ef
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2045,7 +2045,8 @@ public async Task TestWorkspaceDiagnosticsWaitsForLspTextChangesWithMultipleSour
// 1. LSP changed, which triggers immediately via the queue.
// 2. Workspace changed, which can be delayed until after the requests complete.
// To ensure the workspace changed is processed, we need to wait for all workspace events.
await testLspServer.WaitForDiagnosticsAsync();
var listenerProvider = testLspServer.TestWorkspace.GetService<IAsynchronousOperationListenerProvider>();
await listenerProvider.WaitAllDispatcherOperationAndTasksAsync(testLspServer.TestWorkspace);

// Make new requests - these requests should again wait for new changes.
resultTaskOne = RunGetWorkspacePullDiagnosticsAsync(testLspServer, useVSDiagnostics, useProgress: true, category: PullDiagnosticCategories.WorkspaceDocumentsAndProject, triggerConnectionClose: false);
Expand Down

0 comments on commit b5f57ef

Please sign in to comment.