SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.
test: avoid wall-clock assertions in import budget regressions
lillith4c6afc6ba44c
diff --git a/crates/kernel/src/iges_in/tests.rs b/crates/kernel/src/iges_in/tests.rsindex f15ceeb9ea..04fe04112c 100644--- a/crates/kernel/src/iges_in/tests.rs+++ b/crates/kernel/src/iges_in/tests.rs@@ -180,13 +180,12 @@ fn composite_curve_fan_out_is_bounded() {let cos = 2 * ents.len() - 1;ents.push((144, 0, format!("{surface},1,0,{cos}")));- let t = std::time::Instant::now();let reported = match iges_to_step(&iges_file(&ents)) {Ok((_, warnings)) => warnings.join(" "),Err(error) => error,};+ // Check the work-budget rejection, not elapsed time: CI runs test binaries concurrently.assert!(reported.contains("too complex") || reported.contains("too many segments"), "{reported}");- assert!(t.elapsed() < std::time::Duration::from_secs(10), "took {:?}", t.elapsed());}/// Nothing stops directory entries from all naming the same parameter range, and each onediff --git a/crates/kernel/src/step_in/tests.rs b/crates/kernel/src/step_in/tests.rsindex 74ed53fa61..b8a92dfc01 100644--- a/crates/kernel/src/step_in/tests.rs+++ b/crates/kernel/src/step_in/tests.rs@@ -644,10 +644,9 @@ fn knot_multiplicities_are_checked_before_they_are_expanded() {let cx = Ctx { ex: &ex, len: 1.0, ang: 1.0, tol: 1e-6 };geom::curve(&cx, 3, 0)};- let t = std::time::Instant::now();let error = read(&curve(1_000_000, 64)).unwrap_err();+ // This diagnostic comes from the check before expansion; wall-clock time depends on CI load.assert!(error.contains("knot multiplicities do not match"), "{error}");- assert!(t.elapsed() < std::time::Duration::from_secs(5), "took {:?}", t.elapsed());// A degree-1 curve with two control points needs exactly four knot values.assert!(read(&curve(2, 2)).is_ok());assert!(read(&curve(4, 1)).is_ok());