From ab8b7a7aa2aa4e615bb4f5943c3e1fa4ff9ff544 Mon Sep 17 00:00:00 2001 From: Yaroslav Vasylenko Date: Fri, 1 May 2026 07:32:09 +0300 Subject: [PATCH] fix(test_integrity_v2): widen HRV subject request to absorb wfdb flake MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TestHRV::test_gamma_in_range requested n_subjects=3 — exactly the floor enforced in HRVPhysioNetAdapter._ensure_loaded. A single PhysioNet/wfdb network glitch dropping one record made the test fail with "Insufficient HRV data: 2 subjects" (CI run 25184505044, Verify 3.12). Same SHA passed on Verify 3.10 and 3.11 — pure transient flake, not a Python-version regression. Raise the ask to 5 (margin of 2) so the test stays green when up to two records are skipped during _load(). Floor and physics are unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) --- tests/test_integrity_v2.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_integrity_v2.py b/tests/test_integrity_v2.py index 04fb3892..68790a6d 100644 --- a/tests/test_integrity_v2.py +++ b/tests/test_integrity_v2.py @@ -132,7 +132,11 @@ class TestHRV: def test_gamma_in_range(self): from substrates.hrv_physionet.adapter import HRVPhysioNetAdapter - adapter = HRVPhysioNetAdapter(n_subjects=3) + # Request 5 subjects: _ensure_loaded floor is 3, so a 5-request gives + # a margin of 2 against transient PhysioNet/wfdb load failures that + # caused intermittent 3.12 fails (run 25184505044, "Insufficient HRV + # data: 2 subjects"). At n=3 a single dropped record was fatal. + adapter = HRVPhysioNetAdapter(n_subjects=5) result = adapter.get_gamma_result() assert 0.5 <= result["gamma"] <= 1.5, f"HRV gamma={result['gamma']}"