diff --git a/gpui/src/platform/mac/fonts.rs b/gpui/src/platform/mac/fonts.rs index b1605c8b0bad63..036809f059fa54 100644 --- a/gpui/src/platform/mac/fonts.rs +++ b/gpui/src/platform/mac/fonts.rs @@ -319,7 +319,20 @@ mod tests { fn test_layout_str() -> anyhow::Result<()> { let fonts = FontSystem::new(); let menlo = fonts.load_family("Menlo")?; - let menlo_regular = fonts.select_font(&menlo, &Properties::new())?; + + // Added to investigate flaky tests we're seeing on CI. https://github.com/zed-industries/zed/issues/85 + assert_eq!(menlo.len(), 4); + let mut loaded_bold = false; + for font_id in &menlo { + let font = &fonts.0.write().fonts[font_id.0]; + assert_eq!(font.family_name(), "Menlo"); + if font.style_name() == "Bold" { + loaded_bold = true; + } + } + assert!(loaded_bold, "bold was never loaded"); + + let menlo_regular = fonts.select_font(&menlo, &Properties::default())?; let menlo_italic = fonts.select_font(&menlo, &Properties::new().style(Style::Italic))?; let menlo_bold = fonts.select_font(&menlo, &Properties::new().weight(Weight::BOLD))?; assert_ne!(menlo_regular, menlo_italic); diff --git a/zed/src/file_finder.rs b/zed/src/file_finder.rs index 83227f309f5c35..9c8cf61c99d942 100644 --- a/zed/src/file_finder.rs +++ b/zed/src/file_finder.rs @@ -677,9 +677,20 @@ mod tests { ) }) .await; - cx.read(|cx| workspace.read(cx).worktree_scans_complete(cx)) + + workspace + .read_with(&cx, |workspace, cx| workspace.worktree_scans_complete(cx)) .await; + // Added to investigate flaky tests we're seeing on CI. https://github.com/zed-industries/zed/issues/87 + workspace.read_with(&cx, |workspace, cx| { + let worktrees = workspace.worktrees(); + assert_eq!(worktrees.len(), 2); + for worktree in worktrees { + assert_eq!(worktree.read(cx).file_count(), 1); + } + }); + let (_, finder) = cx.add_window(|cx| FileFinder::new(app_state.settings, workspace.clone(), cx));