mirror of
https://github.com/storytold/filmcraft.git
synced 2026-11-02 18:09:21 +00:00
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:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user