test: avoid wall-clock assertions in import budget regressions
This commit is contained in:
1 parent
d9d4dd262d
commit
4c6afc6ba4
2 files changed
+2
-4
No files matched your search
@@ -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 one
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in new issue
Block a user