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:
co-authored by
genichin
parent
4a2e7dd893
commit
9c5a01ed67
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user