From fa6156232ac8c58d8093b488991fa80ba8177b4f Mon Sep 17 00:00:00 2001 From: "idra (via Hark)" Date: Sun, 11 Oct 2026 20:15:56 +0000 Subject: [PATCH] test(self-update): compare install budgets with pytest.approx The cold-target budget is computed as (deadline - now) in float seconds and can land one ULP under 900 when time.monotonic() is large, failing the exact list comparison on long-running CI hosts (899.9999999999999 != 900). Inherited from upstream 956e7896. --- tests/unit/infra/setup/test_self_update.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/unit/infra/setup/test_self_update.py b/tests/unit/infra/setup/test_self_update.py index d6989daba8..3266f284cd 100644 --- a/tests/unit/infra/setup/test_self_update.py +++ b/tests/unit/infra/setup/test_self_update.py @@ -1168,7 +1168,10 @@ def cold_install( monkeypatch.setattr(self_update, "_run_install_cmd", cold_install) result = self_update._run_managed_upgrade(version="1.0.2b5", locale="en") assert result.success is (portable and installer == "pip") - assert budgets == ([90, 900] if portable and installer == "pip" else [90]) + # The budget is (deadline - now) in float seconds, so it can land a ULP + # under 900 when time.monotonic() is large (long-running CI hosts). + expected = [90, 900] if portable and installer == "pip" else [90] + assert budgets == pytest.approx(expected) # The desktop launcher compares versions with its own Go implementation