@@ -33,6 +33,10 @@ async def stream(
3333 raise NotImplementedError ()
3434 yield
3535
36+ async def dispose (self ) -> None :
37+ """Dispose resources if any."""
38+ pass
39+
3640
3741class MockRuntimeA (BaseMockRuntime ):
3842 """Mock runtime A for testing."""
@@ -109,7 +113,7 @@ class UiPathTestRuntimeFactory:
109113 def __init__ (self , runtime_class : type [UiPathRuntimeProtocol ]):
110114 self .runtime_class = runtime_class
111115
112- def new_runtime (self , entrypoint : str ) -> UiPathRuntimeProtocol :
116+ async def new_runtime (self , entrypoint : str ) -> UiPathRuntimeProtocol :
113117 return self .runtime_class ()
114118
115119
@@ -124,21 +128,21 @@ async def test_multiple_factories_same_executor():
124128 factory_c = UiPathTestRuntimeFactory (MockRuntimeC )
125129
126130 # Execute runtime A
127- runtime_a = factory_a .new_runtime (entrypoint = "" )
131+ runtime_a = await factory_a .new_runtime (entrypoint = "" )
128132 execution_runtime_a = UiPathExecutionRuntime (
129133 runtime_a , trace_manager , "runtime-a-span" , execution_id = "exec-a"
130134 )
131135 result_a = await execution_runtime_a .execute ({"input" : "a" })
132136
133137 # Execute runtime B
134- runtime_b = factory_b .new_runtime (entrypoint = "" )
138+ runtime_b = await factory_b .new_runtime (entrypoint = "" )
135139 execution_runtime_b = UiPathExecutionRuntime (
136140 runtime_b , trace_manager , "runtime-b-span" , execution_id = "exec-b"
137141 )
138142 result_b = await execution_runtime_b .execute ({"input" : "b" })
139143
140144 # Execute runtime C with custom spans
141- runtime_c = factory_c .new_runtime (entrypoint = "" )
145+ runtime_c = await factory_c .new_runtime (entrypoint = "" )
142146 execution_runtime_c = UiPathExecutionRuntime (
143147 runtime_c , trace_manager , "runtime-c-span" , execution_id = "exec-c"
144148 )
0 commit comments