Best Python code snippet using slash
server.py
Source:server.py
...78 def get_connected_clients(self):79 return self.connected_clients.copy()80 def has_more_tests(self):81 return len(self.finished_tests) < len(self.tests)82 def report_client_failure(self, client_id):83 self.connected_clients.remove(client_id)84 test_index = self.executing_tests.get(client_id, None)85 if test_index is not None:86 _logger.error("Worker {} interrupted while executing test {}", client_id,87 self.tests[test_index].__slash__.address, extra={'capture': False})88 with _get_test_context(self.tests[test_index], logging=False) as (result, _):89 result.mark_interrupted()90 self.finished_tests.append(test_index)91 self.state = ServerStates.STOP_TESTS_SERVING92 self._mark_unrun_tests()93 self.worker_error_reported = True94 def get_unstarted_tests(self):95 return self._tests_distrubuter.get_unstarted_tests()96 def _mark_unrun_tests(self):...
parallel_manager.py
Source:parallel_manager.py
...83 if time.time() - worker_last_connection_time > config.root.parallel.communication_timeout_secs: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))...
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!!