Best Python code snippet using slash
parallel_manager.py
Source:parallel_manager.py
...84 _logger.error("Worker {} is down, terminating session", worker_id, extra={'capture': False})85 self.report_worker_error_logs()86 self.workers[worker_id].handle_timeout()87 get_xmlrpc_proxy(config.root.parallel.server_addr, self.server.port).report_client_failure(worker_id)88 def check_no_requests_timeout(self):89 if time.time() - self.keepalive_server.last_request_time > config.root.parallel.no_request_timeout:90 _logger.error("No request sent to server for {} seconds, terminating",91 config.root.parallel.no_request_timeout, extra={'capture': False})92 if self.server.has_connected_clients():93 _logger.error("Clients that are still connected to server: {}",94 self.server.connected_clients, extra={'capture': False})95 if self.server.has_more_tests():96 _logger.error("Number of unstarted tests: {}", len(self.server.get_unstarted_tests()),97 extra={'capture': False})98 if self.server.executing_tests:99 _logger.error("Currently executed tests indexes: {}", self.server.executing_tests.values(),100 extra={'capture': False})101 self.handle_error("No request sent to server for {} seconds, terminating".format(config.root.parallel.no_request_timeout))102 def start(self):103 self.try_connect()104 try:105 for worker in list(self.workers.values()):106 worker.start()107 self.wait_all_workers_to_connect()108 while self.server.should_wait_for_request():109 self.check_worker_timed_out()110 self.check_no_requests_timeout()111 time.sleep(TIME_BETWEEN_CHECKS)112 except INTERRUPTION_EXCEPTIONS:113 _logger.error("Server interrupted, stopping workers and terminating", extra={'capture': False})114 get_xmlrpc_proxy(config.root.parallel.server_addr, self.server.port).session_interrupted()115 self.kill_workers()116 raise117 finally:118 for worker in list(self.workers.values()):119 worker.wait_to_finish()120 get_xmlrpc_proxy(config.root.parallel.server_addr, self.server.port).stop_serve()121 get_xmlrpc_proxy(config.root.parallel.server_addr, self.keepalive_server.port).stop_serve()122 self.server_thread.join()...
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!