Skip to content

Commit aadf30a

Browse files
committed
test(lsp): give rename_test enough wall time for the LSP to compile the file
The rename_test exercised a real race: after `DidOpen` the LSP server kicks off the parse/typecheck of the file in the background, and the test only slept 100 ms before sending `textDocument/rename`. On any slower CI runner (Windows, macos-15-intel) the database hadn't reached `DBState::Ready` yet, so the request hit `handle_rename`, fell into `try_get_db`, and the path either wasn't in the VFS or the analysis db was still `Compiling`. The handler returned `Ok(None)`, the test assertion failed with `left: Null` and the suite went red. Bumping the wait to 1 s matches what the only other LSP test with a real cold-start (the kpm download case) already uses (`wait_async!(2000)`). Verified locally: rename_test now passes deterministically; pkg_mod_test is an unrelated, pre-existing failure caused by a kcl.mod path typo in test_data, not something this test exercises. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c7be821 commit aadf30a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

crates/tools/src/LSP/src/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1588,7 +1588,7 @@ fn rename_test() {
15881588
};
15891589
let server = Project {}.server(initialize_params);
15901590

1591-
wait_async!();
1591+
wait_async!(1000);
15921592

15931593
let url = Url::from_file_path(path).unwrap();
15941594
let main_url = Url::from_file_path(main_path).unwrap();

0 commit comments

Comments
 (0)