File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717
1818from google .adk .events .event import Event
1919from google .adk .memory .in_memory_memory_service import InMemoryMemoryService
20+ from google .adk .platform import thread as platform_thread
2021from google .adk .sessions .session import Session
2122from google .genai import types
2223import pytest
@@ -438,9 +439,9 @@ def reader():
438439 loop .close ()
439440
440441 threads = [
441- threading . Thread ( target = writer ),
442- threading . Thread ( target = reader ),
443- threading . Thread ( target = reader ),
442+ platform_thread . create_thread ( writer ),
443+ platform_thread . create_thread ( reader ),
444+ platform_thread . create_thread ( reader ),
444445 ]
445446 for thread in threads :
446447 thread .start ()
Original file line number Diff line number Diff line change 3131from google .adk .events import event_actions as event_actions_lib
3232from google .adk .models import llm_request as llm_request_lib
3333from google .adk .models import llm_response as llm_response_lib
34+ from google .adk .platform import thread as platform_thread
3435from google .adk .plugins import bigquery_agent_analytics_plugin
3536from google .adk .plugins import plugin_manager as plugin_manager_lib
3637from google .adk .sessions import base_session_service as base_session_service_lib
@@ -10357,7 +10358,9 @@ def run_in_fresh_loop():
1035710358 except BaseException as e : # noqa: BLE001 - collecting for assertion
1035810359 errors .append (e )
1035910360
10360- threads = [threading .Thread (target = run_in_fresh_loop ) for _ in range (2 )]
10361+ threads = [
10362+ platform_thread .create_thread (run_in_fresh_loop ) for _ in range (2 )
10363+ ]
1036110364 for t in threads :
1036210365 t .start ()
1036310366 for t in threads :
@@ -10487,7 +10490,9 @@ def run_in_fresh_loop():
1048710490 except BaseException as e : # noqa: BLE001
1048810491 errors .append (e )
1048910492
10490- threads = [threading .Thread (target = run_in_fresh_loop ) for _ in range (2 )]
10493+ threads = [
10494+ platform_thread .create_thread (run_in_fresh_loop ) for _ in range (2 )
10495+ ]
1049110496 for t in threads :
1049210497 t .start ()
1049310498 # Deterministic rendezvous: hold the owner inside setup until BOTH
@@ -10534,7 +10539,9 @@ def run_in_fresh_loop():
1053410539 except BaseException as e : # noqa: BLE001
1053510540 errors .append (e )
1053610541
10537- threads = [threading .Thread (target = run_in_fresh_loop ) for _ in range (2 )]
10542+ threads = [
10543+ platform_thread .create_thread (run_in_fresh_loop ) for _ in range (2 )
10544+ ]
1053810545 for t in threads :
1053910546 t .start ()
1054010547 entered .wait (timeout = 5 )
You can’t perform that action at this time.
0 commit comments