diff --git a/ovn-tester/ovn_workload.py b/ovn-tester/ovn_workload.py index 2a2f988e..7cafd159 100644 --- a/ovn-tester/ovn_workload.py +++ b/ovn-tester/ovn_workload.py @@ -640,12 +640,14 @@ async def create_cluster_join_switch(self, sw_name): ) async def provision_ports(self, n_ports, passive=False): - ret_list = [] + tasks = [] + ctx = ovn_context.active_context for _ in range(n_ports): worker = self.select_worker_for_port() - ports = await worker.provision_ports(self, 1, passive) - ret_list.append(ports[0]) - return ret_list + tasks.append(ctx.create_task(worker.provision_ports(self, 1, + passive))) + results = await asyncio.gather(*tasks) + return [ports[0] for ports in results] async def unprovision_ports(self, ports): for port in ports: