From 371e9679ed7f1c6709164e69cd871ec4ec203d2a Mon Sep 17 00:00:00 2001 From: BREW <81044362+b-re-w@users.noreply.github.com> Date: Sun, 1 Nov 2026 10:53:02 +0900 Subject: [PATCH] Test: Make mid() loop heavier in test_eval_breaker to avoid CI timing flake (#280) --- .../src/test/python/test_eval_breaker.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/python-multiplatform-ksp/src/test/python/test_eval_breaker.py b/python-multiplatform-ksp/src/test/python/test_eval_breaker.py index dece8d3b..faea4a5a 100644 --- a/python-multiplatform-ksp/src/test/python/test_eval_breaker.py +++ b/python-multiplatform-ksp/src/test/python/test_eval_breaker.py @@ -397,7 +397,10 @@ def test_keyboard_interrupt_reaches_a_long_range_loop_in_chunks(extension): def mid(n: int) -> float: x: float = 1.0 for k in range(n): - x = x * 0.9999999 + 1.0 / (k + 1.0) + x = (x + 1.0) / (x + 2.0) + 1.0 / (k + 1.0) + x = (x + 1.0) / (x + 2.0) + 1.0 / (k + 2.0) + x = (x + 1.0) / (x + 2.0) + 1.0 / (k + 3.0) + x = (x + 1.0) / (x + 2.0) + 1.0 / (k + 4.0) return x """ @@ -419,7 +422,7 @@ def handler(signum, frame): t0 = time.perf_counter() m.mid(n) full = time.perf_counter() - t0 - signal.setitimer(signal.ITIMER_REAL, full / 10) + signal.setitimer(signal.ITIMER_REAL, full / 20) t0 = time.perf_counter() try: m.mid(n) @@ -430,4 +433,5 @@ def handler(signum, frame): print(json.dumps({"out": out, "full": full, "elapsed": time.perf_counter() - t0})) """) assert r["out"] == "interrupted", r + assert r["full"] > 0.1, r assert r["elapsed"] < r["full"] * 0.8, r # before #280 the signal waited for the whole loop