diff --git a/crates/editor/src/inlay_hint_cache.rs b/crates/editor/src/inlay_hint_cache.rs index b5ccdb4f2d940afe4932a13be040160c8d4187d1..70cccf21da391d9308ece455d0de09768f68f280 100644 --- a/crates/editor/src/inlay_hint_cache.rs +++ b/crates/editor/src/inlay_hint_cache.rs @@ -2001,7 +2001,7 @@ mod tests { }); } - #[gpui::test] + #[gpui::test(iterations = 10)] async fn test_multiple_excerpts_large_multibuffer( deterministic: Arc, cx: &mut gpui::TestAppContext, @@ -2335,10 +2335,12 @@ mod tests { all hints should be invalidated and requeried for all of its visible excerpts" ); assert_eq!(expected_layers, visible_hint_labels(editor, cx)); - assert_eq!( - editor.inlay_hint_cache().version, - last_scroll_update_version + expected_layers.len(), - "Due to every excerpt having one hint, cache should update per new excerpt received" + + let current_cache_version = editor.inlay_hint_cache().version; + let minimum_expected_version = last_scroll_update_version + expected_layers.len(); + assert!( + current_cache_version == minimum_expected_version || current_cache_version == minimum_expected_version + 1, + "Due to every excerpt having one hint, cache should update per new excerpt received + 1 potential sporadic update" ); }); }