def wait_for_finish(self):
if not self.interrupted.is_set():<EOL><INDENT>logger.info("<STR_LIT>")<EOL>logger.info('<STR_LIT>'.format(dir=self.artifacts_dir))<EOL>self.publish("<STR_LIT>", "<STR_LIT>", "<STR_LIT>")<EOL>if not self.plugins:<EOL><INDENT>raise RuntimeError("<STR_LIT>")<EOL><DEDENT><DEDENT>while not self.interrupted.is_set():<EOL><INDENT>begin_time = time.time()<EOL>aggr_retcode = self.job.aggregator.is_test_finished()<EOL>if aggr_retcode >= <NUM_LIT:0>:<EOL><INDENT>return aggr_retcode<EOL><DEDENT>for plugin in self.plugins.values():<EOL><INDENT>logger.debug("<STR_LIT>", plugin)<EOL>retcode = plugin.is_test_finished()<EOL>if retcode >= <NUM_LIT:0>:<EOL><INDENT>return retcode<EOL><DEDENT><DEDENT>end_time = time.time()<EOL>diff = end_time - begin_time<EOL>logger.debug("<STR_LIT>", diff)<EOL>logger.debug("<STR_LIT>", json.dumps(self.status))<EOL>if diff < <NUM_LIT:0.5>:<EOL><INDENT>time.sleep(<NUM_LIT:0.5> - diff)<EOL><DEDENT><DEDENT>return <NUM_LIT:1><EOL>
Call is_test_finished() on all plugins 'till one of them initiates exit