SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.
io: the 3MF and DXF budget tests do not check wall-clock time (#2998) (#2999)
kezmdor5a9e771cc959
diff --git a/crates/io/src/dxf.rs b/crates/io/src/dxf.rsindex 2d8be4207a..df792bd7bd 100644--- a/crates/io/src/dxf.rs+++ b/crates/io/src/dxf.rs@@ -542,8 +542,6 @@ mod tests {/// self-inserts fan out to 6^16 visits for no output. Both shapes must be refused quickly.#[test]fn empty_blocks_do_not_fan_out() {- let t = std::time::Instant::now();-let fanout = format!("0\nSECTION\n2\nBLOCKS\n0\nBLOCK\n2\nA\n{}0\nENDBLK\n0\nENDSEC\n0\nSECTION\n2\nENTITIES\n0\nINSERT\n2\nA\n0\nENDSEC\n0\nEOF\n","0\nINSERT\n2\nA\n".repeat(6)@@ -557,7 +555,5 @@ mod tests {);let g = read_dxf(&array).unwrap_or_default();assert!(g.is_empty(), "an empty block has no geometry to place");-- assert!(t.elapsed() < std::time::Duration::from_secs(5), "took {:?}", t.elapsed());}}diff --git a/crates/io/src/threemf.rs b/crates/io/src/threemf.rsindex 736a4b257b..ef48cc6fe6 100644--- a/crates/io/src/threemf.rs+++ b/crates/io/src/threemf.rs@@ -1352,7 +1352,6 @@ pub(crate) mod tests {/// allocation, which no panic guard can intercept.#[test]fn many_placements_of_a_big_object_stay_bounded() {- let t = std::time::Instant::now();let verts: String = (0..100_000).map(|i| format!("<vertex x=\"{}\" y=\"{}\" z=\"0\"/>", i % 100, i / 100)).collect();let model = format!("{}<object id=\"1\" type=\"model\"><mesh><vertices>{verts}</vertices>\@@ -1364,7 +1363,6 @@ pub(crate) mod tests {assert_eq!(objs.len(), 10_000);// Only the three vertices the one triangle reaches are copied per placement.assert!(objs.iter().all(|o| o.positions.len() == 3 && o.triangles.len() == 1), "{:?}", objs.first().map(|o| o.positions.len()));- assert!(t.elapsed() < std::time::Duration::from_secs(30), "took {:?}", t.elapsed());}/// Objects that only place other objects count toward the budget too: six levels of 300@@ -1372,7 +1370,6 @@ pub(crate) mod tests {/// budget instead of running for days.#[test]fn nested_fan_out_of_empty_objects_is_bounded() {- let t = std::time::Instant::now();let components = |child: u32| (0..300).map(|_| format!(r#"<component objectid="{child}"/>"#)).collect::<String>();let mut objects = r#"<object id="1" type="model"/>"#.to_string();for id in 2..=7 {@@ -1381,7 +1378,6 @@ pub(crate) mod tests {let model = format!(r#"<model unit="millimeter" {PRODUCTION}><resources>{objects}</resources><build><item objectid="7"/></build></model>"#);let err = read_3mf(&package(&model, None)).unwrap_err().to_string();assert!(err.contains("placements"), "{err}");- assert!(t.elapsed() < std::time::Duration::from_secs(30), "took {:?}", t.elapsed());}/// Triangles are budgeted across every placement, so fan-out cannot outrun the cap.