From 906578df394423e65f8de0ad190464290ff42d54 Mon Sep 17 00:00:00 2001 From: yuneng-jiang Date: Tue, 10 Nov 2026 10:52:27 -0800 Subject: [PATCH] test(integration): recognize the model list's lock in the held write helper (#50974) The registry lock fix (#50933) makes add_deployment and set_model_list wait for a held delete on the same lock, taken inside HostedModelList as self._lock. The helper only knew lines spelled with self._deployment_index_lock, so it never saw those two writes reach the lock and timed out after 10 seconds. --- ...est_router_concurrent_deployment_delete_sdk.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 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 9f8aa966335..4cc6aca5a03 100644 --- a/tests/integration/sdk/test_router_concurrent_deployment_delete_sdk.py +++ b/tests/integration/sdk/test_router_concurrent_deployment_delete_sdk.py @@ -39,15 +39,16 @@ def _router_source_files() -> frozenset[str]: return frozenset({_HAND_CHANGES.co_filename, *(path for path in facade_files if path is not None)}) -def _lock_lines(path: str) -> frozenset[int]: - return frozenset( - number - for number, line in enumerate(linecache.getlines(path), start=1) - if "with self._deployment_index_lock" in line - ) +def _lock_lines(path: str, statement: str) -> frozenset[int]: + return frozenset(number for number, line in enumerate(linecache.getlines(path), start=1) if statement in line) -_INDEX_LOCK_LINES: Final = MappingProxyType({path: _lock_lines(path) for path in _router_source_files()}) +_INDEX_LOCK_LINES: Final = MappingProxyType( + { + **{path: _lock_lines(path, "with self._deployment_index_lock") for path in _router_source_files()}, + _LIST_REFRESH.co_filename: _lock_lines(_LIST_REFRESH.co_filename, "with self._lock"), + } +) T = TypeVar("T")