fix(test): give the stale-abort atomicity test a display consumer so "hello" counts as delivered
test_stale_abort_is_atomic_with_holder_read asserts the post-stale-kill death is a no-retry partial (a single stream_error_cleanup close). Its agent had no stream consumer, so the "hello" delta was never recorded as delivered; with the parent commit a death after undelivered deltas is reclassified as an undelivered failure and retried on a fresh client, which added stream_retry_cleanup + a second attempt's close. The test's premise is "died AFTER tokens were delivered", so register a consumer instead of weakening the new classification.
This commit is contained in:
@@ -205,6 +205,10 @@ def test_stale_abort_is_atomic_with_holder_read(monkeypatch):
|
||||
"""
|
||||
monkeypatch.setenv("HERMES_STREAM_STALE_TIMEOUT", "0.05")
|
||||
agent = _make_agent()
|
||||
# A display consumer, so "hello" counts as DELIVERED text: the death after
|
||||
# the stale kill is then a no-retry partial (one stream_error_cleanup close),
|
||||
# not an undelivered failure that retries on a fresh client.
|
||||
agent.stream_delta_callback = lambda text: None
|
||||
|
||||
allow_finish = threading.Event()
|
||||
worker_close_reasons = []
|
||||
|
||||
Reference in New Issue
Block a user