Skip to content

Commit

Permalink
Fix nondeterministic test (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
piotmag769 authored Dec 2, 2024
1 parent ee41ca7 commit 6cfb32e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/e2e/analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ fn test_reload() {
command: "cairo.reload".into(),
..Default::default()
});
ls.wait_for_project_update();

let actual = ls.send_request::<lsp::ext::ViewAnalyzedCrates>(());

Expand Down
7 changes: 6 additions & 1 deletion tests/e2e/support/mock_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ impl MockClient {
},
);

self.wait_for_notification::<ProjectUpdatingFinished>(|_| true);
self.wait_for_project_update();
}

/// Waits for `textDocument/publishDiagnostics` notification for the given file.
Expand All @@ -340,6 +340,11 @@ impl MockClient {
self.open_and_wait_for_project_update(path);
self.wait_for_diagnostics(path)
}

/// Waits for `cairo/projectUpdatingFinished` notification.
pub fn wait_for_project_update(&mut self) {
self.wait_for_notification::<ProjectUpdatingFinished>(|_| true);
}
}

/// Handling workspace configuration workflow.
Expand Down

0 comments on commit 6cfb32e

Please sign in to comment.