From 090fd7058068dea0965520d114690398e7909259 Mon Sep 17 00:00:00 2001 From: aiongg Date: Mon, 23 Nov 2026 03:52:33 +0000 Subject: [PATCH] font-manager: the install-queue trial counts only install runners --- crates/font-manager/tests/it/panel.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/crates/font-manager/tests/it/panel.rs b/crates/font-manager/tests/it/panel.rs index b3664dd02..b75252a80 100644 --- a/crates/font-manager/tests/it/panel.rs +++ b/crates/font-manager/tests/it/panel.rs @@ -50,13 +50,16 @@ fn host_with(sections: Arc, jobs: Arc) -> Arc { type Task = Box; +// The job name of the framework's document-face loads (`craft_ui::fonts`), which the panel's specimens start. +const FACE_JOBS: &str = "craft-document-faces"; + /// Keeps the spawned jobs until the test runs them. #[derive(Default)] -struct Deferred(Mutex>); +struct Deferred(Mutex>); impl Jobs for Deferred { - fn spawn(&self, _: &str, job: Task) { - self.0.lock().unwrap_or_else(PoisonError::into_inner).push(job); + fn spawn(&self, name: &str, job: Task) { + self.0.lock().unwrap_or_else(PoisonError::into_inner).push((name.to_owned(), job)); } } @@ -206,7 +209,12 @@ fn queued_installs_run_one_runner_in_request_order() { rig.click("Install"); rig.click("Install"); - let mut spawned = std::mem::take(&mut *deferred.0.lock().unwrap_or_else(PoisonError::into_inner)); + // The cards' specimens load their faces through the same jobs; only the install runners count here. + let mut spawned: Vec = std::mem::take(&mut *deferred.0.lock().unwrap_or_else(PoisonError::into_inner)) + .into_iter() + .filter(|(name, _)| name != FACE_JOBS) + .map(|(_, job)| job) + .collect(); assert_eq!(spawned.len(), 1, "one runner drains the queue"); assert!(rig.store.calls().is_empty(), "nothing runs before the runner does"); spawned.remove(0)();