From 5d6f19b1aa6a7e0ed4a609ebe7e5eb413f873bb8 Mon Sep 17 00:00:00 2001 From: Jared Lockhart <119884+jaredlockhart@users.noreply.github.com> Date: Tue, 25 Aug 2026 12:20:33 -0400 Subject: [PATCH] fix(nimbus): Approve the Kinto review left by the selenium teardown Because * The selenium teardown called approve() on the kinto_client factory, so it raised AttributeError and was swallowed by the bare except. * end_experiment() still ran, leaving a pending review that a later test signs as if it were its own, cascading until a test finds nothing pending and raises "Unable to approve kinto review". * approve() retries for 120s, so activating the teardown unbounded would burn that budget per test whenever no review is pending. This commit * Calls the factory so the teardown approves via a KintoClient instance. * Adds an optional retries argument to approve(), leaving the default budget unchanged for in-test callers. * Bounds the teardown to a short explicit budget. Fixes #16978 --- experimenter/tests/integration/nimbus/conftest.py | 3 ++- experimenter/tests/integration/nimbus/kinto/client.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/experimenter/tests/integration/nimbus/conftest.py b/experimenter/tests/integration/nimbus/conftest.py index bdb9fc39ad..08b707b645 100755 --- a/experimenter/tests/integration/nimbus/conftest.py +++ b/experimenter/tests/integration/nimbus/conftest.py @@ -55,6 +55,7 @@ def pytest_addoption(parser): KINTO_DRIVING_FIXTURES = frozenset({"kinto_client", "live_rollout"}) +TEARDOWN_APPROVAL_RETRIES = 15 @pytest.hookimpl(tryfirst=True) @@ -172,7 +173,7 @@ def selenium(selenium, experiment_slug, kinto_client): try: if not helpers.is_rollout(experiment_slug): helpers.end_experiment(experiment_slug) - kinto_client.approve() + kinto_client().approve(retries=TEARDOWN_APPROVAL_RETRIES) except Exception: pass diff --git a/experimenter/tests/integration/nimbus/kinto/client.py b/experimenter/tests/integration/nimbus/kinto/client.py index b3db887118..9fd7ae2d97 100755 --- a/experimenter/tests/integration/nimbus/kinto/client.py +++ b/experimenter/tests/integration/nimbus/kinto/client.py @@ -33,8 +33,8 @@ def _fetch_collection_data(self): def _has_pending_review(self): return self._fetch_collection_data()["status"] == KINTO_REVIEW_STATUS - def approve(self): - for _ in range(self.RETRIES): + def approve(self, retries=RETRIES): + for _ in range(retries): if self._has_pending_review(): try: self.kinto_http_client.patch_collection(