engine: mask discard test checks the cancel flag, not the worker's timing (#3899)

replacing_the_project_drops_pending_tracking_jobs asserted the discarded job
reported cancelled or finished within ~100 ms. jobs.list has no cancelled
field, so on slow CI runners the worker had not finished yet and the test
failed (b3aeb7c3, 53b937ab). Check the cancel flag that discard sets
synchronously instead.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Thomas
2026-11-01 16:10:08 -05:00
committed by GitHub
parent ef6c7ece45
commit 8c171a0ab8
+4 -3
View File
@@ -483,9 +483,10 @@ fn replacing_the_project_drops_pending_tracking_jobs() {
}
let project = serde_json::to_string(&*s.project).unwrap().to_lowercase();
assert!(!project.contains("mask"), "stale mask data in new project");
let jobs = s.execute("jobs.list", json!({})).unwrap();
let j = jobs.as_array().unwrap().iter().find(|j| j["id"] == job).unwrap().clone();
assert!(j["cancelled"] == true || j["finished"] == true, "{j}");
// the discarded job was told to stop (the worker may not have noticed yet on a slow machine,
// so its `finished` flag is not waited for)
let j = s.jobs.iter().find(|j| json!(j.id) == job).expect("the tracking job is listed");
assert!(j.progress.cancel.load(std::sync::atomic::Ordering::Relaxed), "{}", j.to_json());
}
#[test]