From cb1fa2e69fd745f5bfbffcbd0b45e534dc9ca6ea Mon Sep 17 00:00:00 2001 From: Alpamys Date: Sun, 7 Jun 2026 16:41:31 +0500 Subject: [PATCH] test(local-rl): de-flake stamp-before-train concurrent-thumbs test on Windows Pre-existing v0.71.13 test flaked on windows-latest CI: record_thumb stamps time.time() and count_new_thumbs_since uses strict `>`, so on Windows' ~15.6ms clock resolution the two mid-train thumbs could land in the same tick as run_started (ts == run_started, dropped). Sleep one clock tick at the start of slow_train so the thumbs are strictly later. Prod semantics unchanged; tests-only. --- tests/test_v07113.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/test_v07113.py b/tests/test_v07113.py index ea4e4e4..6d67b9a 100644 --- a/tests/test_v07113.py +++ b/tests/test_v07113.py @@ -1144,7 +1144,13 @@ class TestReviewFixes: ) def slow_train(*, base_model, pairs_path, output_dir, train_method): - # Simulate a thumb landing mid-train. + # Simulate a thumb landing mid-train. Sleep one clock tick first so + # the thumbs' time.time() ts is strictly greater than run_started on + # coarse-resolution clocks (Windows time.time() ~15.6ms) — otherwise + # a same-tick ts == run_started is dropped by the strict `>` count. + import time as _t + + _t.sleep(0.05) record_thumb( db_path="db.sqlite", prompt="qZ", response="x", thumb="up" )