File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 1414from typing import Any , Optional
1515
1616import grpc
17- from packaging .version import Version
1817
1918from proxy_worker import protos
2019from proxy_worker .logging import (
@@ -102,8 +101,7 @@ def get_global_current_invocation_id() -> Optional[str]:
102101def get_current_invocation_id () -> Optional [Any ]:
103102 global _library_worker
104103 # Check global current invocation first (most up-to-date)
105- if (_library_worker
106- and Version (_library_worker .version .VERSION ) < Version ("1.1.0b4" )):
104+ if _library_worker and not hasattr (_library_worker , 'invocation_id_cv' ):
107105 global_invocation_id = get_global_current_invocation_id ()
108106 if global_invocation_id is not None :
109107 return global_invocation_id
Original file line number Diff line number Diff line change @@ -412,6 +412,9 @@ def setUp(self):
412412 with dispatcher_module ._current_invocation_lock :
413413 dispatcher_module ._current_invocation_id = None
414414
415+ # Clear library worker to ensure tests run with expected state
416+ dispatcher_module ._library_worker = None
417+
415418 def tearDown (self ):
416419 """Clean up after each test"""
417420 # Import the module-level variables properly
@@ -425,6 +428,9 @@ def tearDown(self):
425428 with dispatcher_module ._current_invocation_lock :
426429 dispatcher_module ._current_invocation_id = None
427430
431+ # Clear library worker
432+ dispatcher_module ._library_worker = None
433+
428434 def test_global_invocation_id_set_and_get (self ):
429435 """Test setting and getting global current invocation ID"""
430436 test_id = "test-invocation-123"
You can’t perform that action at this time.
0 commit comments