test(plugins): let the first call in the deadline test start its instance (#1257)

Closes #1248
This commit is contained in:
l0ng-ai
2026-11-04 20:09:44 +08:00
committed by GitHub
parent 82fe52f595
commit 02addfa2c5
+7 -1
View File
@@ -540,7 +540,13 @@ fn edit_path_calls_have_soft_and_hard_deadlines() {
let provider = host.syntax_provider();
let mis = LanguageId::new("mis");
let tokens = provider.highlights(&mis, "fast").unwrap();
// The first call starts the instance, which may take longer than the soft deadline.
let mut tokens = None;
assert!(eventually(|| {
tokens = provider.highlights(&mis, "fast");
tokens.is_some()
}));
let tokens = tokens.unwrap();
assert_eq!((tokens[0].start, tokens[0].end, tokens[0].kind.as_str()), (0, 4, "keyword"));
// Slower than the soft deadline: dropped (however late this thread gets