fix(health): preserve transient failure codes through stale snapshot fallback

Co-authored-by: genichin <4282227+genichin@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-09-12 13:37:45 +00:00
committed by GitHub
co-authored by genichin
parent 4a2e7dd893
commit 9c5a01ed67
3 changed files with 25 additions and 4 deletions
@@ -209,3 +209,15 @@ def test_slots_rpc_normalizes_snapshot_store_read_failure():
with pytest.raises(AccountSnapshotUnavailable) as raised:
service.holdings_for_slots_rpc()
assert raised.value.code == "read_failed"
def test_sell_stale_snapshot_preserves_transient_live_failure_detail_code():
broker, _, service, now = _wire()
assert service.refresh()
broker.balance_error = "timeout"
now[0] += timedelta(seconds=3601)
with pytest.raises(AccountSnapshotUnavailable) as raised:
service.holdings_for_sell()
assert raised.value.code == "expired"
assert raised.value.detail_code == "timeout"