From 7e934d77076b3d385fb57a2384d1fbff2996ccb6 Mon Sep 17 00:00:00 2001 From: BREW <81044362+b-re-w@users.noreply.github.com> Date: Sun, 25 Oct 2026 21:45:50 +0900 Subject: [PATCH] Test: the region signal test re-measures the call before every timer attempt On the macOS CI runner one baseline measurement did not predict the next call's length, so every timer landed after the call and the test failed without any defect. Each of up to 12 attempts now measures first. A mutant without the region field-read guard still fails it. --- .../src/test/python/test_regions.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/python-multiplatform-ksp/src/test/python/test_regions.py b/python-multiplatform-ksp/src/test/python/test_regions.py index 3456586d..27cd2151 100644 --- a/python-multiplatform-ksp/src/test/python/test_regions.py +++ b/python-multiplatform-ksp/src/test/python/test_regions.py @@ -613,15 +613,16 @@ def test_a_class_change_by_a_signal_handler_in_the_consumer_deopts_the_region_ho so = cbuild.build(text, "regsig", tmp_path / "out", runtime_dir=runtime_dir()) m = cbuild.load("regsig", so) d = 21 - t0 = time.perf_counter() - assert m.tree_sum(d) == nodes(d) - delay = 0.85 * (time.perf_counter() - t0) caught = False - for k in range(5): # under load the timer can land after the call; then try again + for k in range(12): # under load the timer can land after the call; then try again + # Re-measured before every attempt: on a shared CI runner one baseline does not predict the + # next call's length, so a single measurement put every timer after the call (#331 run). + t0 = time.perf_counter() + assert m.tree_sum(d) == nodes(d) + delay = (0.85, 0.8, 0.75, 0.7)[k % 4] * (time.perf_counter() - t0) d0 = m.__typedpython_deopts__ o0, f0, _ = m.__typedpython_region_stats__() - got = _with_property_installed_by_handler(lambda: m.tree_sum(d), m.Node, - delay * (0.85, 0.8, 0.9, 0.75, 0.7)[k] / 0.85) + got = _with_property_installed_by_handler(lambda: m.tree_sum(d), m.Node, delay) o1, f1, _ = m.__typedpython_region_stats__() assert o1 - o0 == f1 - f0 if m.__typedpython_deopts__ > d0: # the host noticed and redid the call