дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-05 09:41:34 +02:00
test(index): wait for the snapshot instead of a fixed 150 ms
incremental_changes_refresh_the_warm_start_snapshot failed on loaded CI runners (macOS and Windows): the snapshot is written on the worker's next round after a short delay, which a fixed sleep doesn't always cover. The test now polls for it.
Цей коміт міститься в:
1 джерело
e586923308
коміт
86d06fd44f
1 file changed
+7
-2
@@ -779,8 +779,13 @@ fn incremental_changes_refresh_the_warm_start_snapshot() {
|
||||
let changed = f.write("src/a.rs", "fn renamed() {}\n");
|
||||
idx.update(&[changed], &[]);
|
||||
assert!(idx.wait_idle(WAIT));
|
||||
std::thread::sleep(Duration::from_millis(150));
|
||||
assert!(f.cache.join("index.snapshot").exists(), "a watcher update must regenerate the snapshot");
|
||||
// The snapshot is written after a short delay, on the worker's next round.
|
||||
let snapshot = f.cache.join("index.snapshot");
|
||||
let deadline = std::time::Instant::now() + WAIT;
|
||||
while !snapshot.exists() && std::time::Instant::now() < deadline {
|
||||
std::thread::sleep(Duration::from_millis(20));
|
||||
}
|
||||
assert!(snapshot.exists(), "a watcher update must regenerate the snapshot");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in new issue
Заблокувати користувача