From 80471419813a0f4d7289da1365d27855d7945a91 Mon Sep 17 00:00:00 2001 From: Kris Austin Date: Wed, 19 Aug 2026 09:28:58 -0500 Subject: [PATCH] test: fix the flaky multiline lightning smoothing assertion (#15294) --- tests/fff_print/test_fill.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/fff_print/test_fill.cpp b/tests/fff_print/test_fill.cpp index 07460d3990..21a5000401 100644 --- a/tests/fff_print/test_fill.cpp +++ b/tests/fff_print/test_fill.cpp @@ -980,7 +980,11 @@ TEST_CASE("Smoothing multiline lightning infill keeps its outlines connected", " const SparseInfillShape smooth = shape_for("100%"); REQUIRE(sharp.path_count > 0); - REQUIRE(smooth.path_count <= sharp.path_count); + // The loop count varies by a loop or two between platforms and between runs, so this is not an + // exact comparison. Smoothing should leave it about where it was; uncapping the smoothing + // reach, the regression this guards against, adds about 10%. + const size_t allowed_extra = sharp.path_count / 50; // 2% + REQUIRE(smooth.path_count <= sharp.path_count + allowed_extra); // The outlines are still rounded. REQUIRE(smooth.point_count > sharp.point_count); REQUIRE(smooth.sharp_turns < sharp.sharp_turns);