mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-15 20:34:18 +00:00
Tests: the CSS, glow and .ai Zstandard guards count work instead of timing it
Three tests failed on a loaded machine because they asserted elapsed time. Each now counts the work that the slow behavior it guards against would repeat, with a counter compiled only into tests: - The CSS cascade test counts selector tests, at most two per element (testing every rule against every element tests N x N). It styles 5,000 elements, so the slow behavior fails on the count rather than on the hang guard, which now waits 300 s. - The stacked-glow test counts the silhouettes drawn, 30 for 30 glows with and without the shadow cache. - The Zstandard frames test counts the bytes looked at to find the zero padding. The hang guards for invalid dash patterns, text layout and script checks of a pipe wait 300 s instead of 20 s.
This commit is contained in:
@@ -140,7 +140,7 @@ fn pipes_and_folders_are_not_read() {
|
||||
let direct = s.execute("script.check", &json!({ "path": pipe })).map_err(|e| e.to_string());
|
||||
let _ = tx.send((included.map_err(|e| e.to_string()), direct));
|
||||
});
|
||||
let (included, direct) = rx.recv_timeout(std::time::Duration::from_secs(20)).expect("the checks return");
|
||||
let (included, direct) = rx.recv_timeout(std::time::Duration::from_secs(300)).expect("the checks return");
|
||||
let statuses: Vec<String> = included.unwrap().as_array().unwrap().iter().map(|i| i["status"].as_str().unwrap().to_string()).collect();
|
||||
assert_eq!(statuses, ["missing", "missing"]);
|
||||
assert!(direct.is_err_and(|e| e.contains("not a file")));
|
||||
|
||||
Reference in New Issue
Block a user