test(photon): drain detached fatal-notification task in zombie watchdog test
The lifecycle cluster made fatal notifications detached; the watchdog test still asserted synchronously.
This commit is contained in:
parent
f2364f1f81
commit
5940026245
|
|
@ -23,6 +23,7 @@ gRPC traffic occurs.
|
|||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import json
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
|
@ -240,6 +241,13 @@ async def test_monitor_still_raises_fatal_when_zombie_degrades_stream(
|
|||
|
||||
await adapter._monitor_sidecar_health()
|
||||
|
||||
# Fatal notification is dispatched from a detached task (so callers can't
|
||||
# cancel their own handoff) — drain pending tasks before asserting.
|
||||
for _ in range(50):
|
||||
if notified:
|
||||
break
|
||||
await asyncio.sleep(0)
|
||||
|
||||
assert adapter.has_fatal_error is True
|
||||
assert adapter.fatal_error_code == "UPSTREAM_STREAM_DEGRADED"
|
||||
assert adapter.fatal_error_retryable is True
|
||||
|
|
|
|||
Loading…
Reference in New Issue