test(layers): synchronize thumbnail queue assertion (#6318)

This commit is contained in:
Christian Lappin
2026-11-09 12:50:22 -05:00
parent 9086ff3e96
commit 99a6e40323
@@ -957,10 +957,15 @@ mod tests {
assert!(thumbs.texture(&ctx, &src_b, n, 24).is_some(), "the shown document's thumbnails are shown");
}
// Shown again, document 1's rows are asked for again and come back.
// Hold the worker so texture() cannot collect a completed row before the count.
let release = hold(&thumbs);
for n in &a_rows {
assert!(thumbs.texture(&ctx, &src_a, n, 24).is_none());
}
assert_eq!(thumbs.pending.keys().filter(|k| k.0 == 1).count(), 3);
release.send(()).expect("the held job is waiting");
let held = thumbs.worker.as_ref().and_then(ThumbWorker::wait).expect("the held job finishes");
assert_eq!(held.key.0, (0, NodeId(0)));
for _ in &a_rows {
receive_checked(&ctx, &mut thumbs, 1, &a, &a_rows);
}