Expect uncertain delivery when timeout acceptance cannot be ruled out
All checks were successful
Transactional mail acceptance / mail (push) Successful in 1m0s
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 1s
Build and Publish Container Image / build-and-push (push) Successful in 42s

Assistant: codex
Assistant-Model: gpt-6-astra
Assistant-Session: 01a092fe-13b1-7f12-ac74-7d258af4d79c
This commit is contained in:
tegwick 2026-09-13 22:13:06 +02:00
parent 0fcfddc342
commit 8984a84cfd

View file

@ -118,10 +118,10 @@ def test_suppression_blocks_send(tmp_path):
def test_provider_timeout_temporary_and_permanent_are_redacted(tmp_path):
cases = [
(ProviderError("provider_timeout", retryable=True), "503", True),
(ProviderError("provider_timeout", retryable=True), "422", False),
(ProviderError("temporary_deferral", retryable=True), "503", True),
(ProviderError("permanent_rejection", retryable=False), "422", False),
(ProviderError("provider_unavailable", retryable=True), "503", True),
(ProviderError("provider_unavailable", retryable=True), "422", False),
]
for err, code_prefix, retryable in cases:
app = TransactionalApplication(
@ -132,7 +132,7 @@ def test_provider_timeout_temporary_and_permanent_are_redacted(tmp_path):
)
status, body = invoke(app, event(event_id=f"evt-{err.code}"))
assert status.startswith(code_prefix), (err.code, status, body)
assert body["error"] == err.code
assert body["error"] == ("delivery_outcome_unknown" if err.code in {"provider_timeout", "provider_unavailable"} else err.code)
assert body["retryable"] is retryable
# Diagnostics must stay redacted: no SMTP host, password, or exception text.
blob = json.dumps(body)