From 2cdc47194fb3c395c1cab40770b84434f3306124 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Fri, 2 Oct 2026 20:16:35 -0700 Subject: [PATCH] test(integration): delete the pinned key's interaction with a second key A key whose budget is filled by its own reservation is refused on every route, the DELETE included, so the cell now asserts that 422 and sends the delete with a second key, which is what the reservation release on another replica needs in order to be observable at all --- .../spend/test_background_interaction_settlement.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/integration/spend/test_background_interaction_settlement.py b/tests/integration/spend/test_background_interaction_settlement.py index c9cf7a9b882..11444396697 100644 --- a/tests/integration/spend/test_background_interaction_settlement.py +++ b/tests/integration/spend/test_background_interaction_settlement.py @@ -675,13 +675,18 @@ def test_settlement_on_another_replica_releases_the_creators_budget_reservation( with rig.creator.scenario() as scenario: model: Final = rig.models.in_progress key: Final = scenario.key(max_budget=0.5 * _reservation_pin(rig.creator, model)) + janitor: Final = scenario.key() first: Final = _create(rig.creator, model, key) pinned: Final = rig.creator.request( "POST", "/v1beta/interactions", {"model": model, "input": "settle pinned", "background": True}, key=key ) assert pinned.status_code == 422 and pinned.json()["error"]["type"] == "budget_exceeded", pinned.text _state(rig, first, _completed()) - deleted: Final = _delete(rig.settler, first, key) + still_pinned: Final = _delete(rig.settler, first, key) + assert still_pinned.status_code == 422 and still_pinned.json()["error"]["type"] == "budget_exceeded", ( + still_pinned.text + ) + deleted: Final = _delete(rig.settler, first, janitor) assert deleted.status_code == 200, deleted.text spend: Final = _assert_billed(_await_spend_row(first), _rates(rig.creator, model)) _await_key_spend(rig.creator, key, spend)