From 4e97503afa2c733052dff35049da346127cd1398 Mon Sep 17 00:00:00 2001 From: "devin-ai-integration[bot]" <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sat, 14 Nov 2026 23:57:30 +0000 Subject: [PATCH] test(router): hold the concurrent upsert where its build reads the list back (#51878) Co-authored-by: mateo <277851410+mateo-berri@users.noreply.github.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../test_router_concurrent_deployment_delete_sdk.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/integration/sdk/test_router_concurrent_deployment_delete_sdk.py b/tests/integration/sdk/test_router_concurrent_deployment_delete_sdk.py index 4cc6aca5a03..f27e05c781e 100644 --- a/tests/integration/sdk/test_router_concurrent_deployment_delete_sdk.py +++ b/tests/integration/sdk/test_router_concurrent_deployment_delete_sdk.py @@ -32,6 +32,12 @@ _CHURN_UPSERTS: Final = 120 _UNREPORTED_MODEL_ID: Final = frozenset({"aresponses-stream", "aanthropic-messages"}) _LIST_REFRESH: Final = HostedModelList.refresh.__code__ _HAND_CHANGES: Final = HostRegistry._hand_changes.__code__ +_REREADS_AFTER_A_WRITE: Final = frozenset( + { + (_LIST_REFRESH, _HAND_CHANGES), + (HostedModelList.end_build.__code__, HostRegistry._run_build.__code__), + } +) def _router_source_files() -> frozenset[str]: @@ -104,9 +110,7 @@ def _read_during_held_write(read: Callable[[], T], write: Callable[[], object]) def hold_at_reindex(frame: FrameType, event: str, _arg: object) -> None: caller: Final = frame.f_back - refreshes_after_a_write: Final = ( - frame.f_code is _LIST_REFRESH and caller is not None and caller.f_code is _HAND_CHANGES - ) + refreshes_after_a_write: Final = caller is not None and (frame.f_code, caller.f_code) in _REREADS_AFTER_A_WRITE if event == "call" and refreshes_after_a_write and not held.is_set(): held.set() released_in_time.append(release.wait(timeout=_SYNC_SECONDS))