How to use _submit_runner_tasks method in lisa

Best Python code snippet using lisa_python

runner.py

Source:runner.py Github

copy

Full Screen

...268 runner.initialize()269 self._runners.append(runner)270 self._runner_count += 1271 yield runner272 def _submit_runner_tasks(273 self,274 runner: BaseRunner,275 task_manager: TaskManager[None],276 ) -> bool:277 has_task: bool = False278 while not runner.is_done and task_manager.has_idle_worker():279 # fetch a task and submit280 task = runner.fetch_task()281 if task:282 if isinstance(task, Task):283 task_manager.submit_task(task)284 else:285 raise LisaException(f"Unknown task type: '{type(task)}'")286 has_task = True287 else:288 # current runner may not be done, but it doesn't289 # have task temporarily. The root runner can start290 # tasks from next runner.291 break292 return has_task293 def _start_loop(self) -> None:294 # in case all of runners are disabled295 runner_iterator = self._fetch_runners()296 remaining_runners: List[BaseRunner] = []297 run_message = messages.TestRunMessage(298 status=messages.TestRunStatus.RUNNING,299 )300 notifier.notify(run_message)301 task_manager = TaskManager[None](self._max_concurrency, is_verbose=True)302 # set the global task manager for cancellation check303 set_global_task_manager(task_manager)304 has_more_runner = True305 # run until no idle workers are available and all runner are closed306 while task_manager.wait_worker() or has_more_runner or remaining_runners:307 assert task_manager.has_idle_worker()308 # submit tasks until idle workers are available309 while task_manager.has_idle_worker():310 for runner in remaining_runners[:]:311 has_task = self._submit_runner_tasks(runner, task_manager)312 if runner.is_done:313 runner.close()314 remaining_runners.remove(runner)315 self._runners.remove(runner)316 if has_task:317 # This makes the loop is deep first. It intends to318 # complete the prior runners firstly, instead of start319 # later runners.320 continue321 if not self._idle_logged:322 self._log.debug(323 f"running count: {task_manager.running_count}, "324 f"id: {[x.id for x in remaining_runners]} "325 )...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run lisa automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful