def __discover_jmeter_udp_port(self):
r = re.compile(self.DISCOVER_PORT_PATTERN)<EOL>with open(self.process_stderr.name, '<STR_LIT:r>') as f:<EOL><INDENT>cnt = <NUM_LIT:0><EOL>while self.process.pid and cnt < <NUM_LIT:10>:<EOL><INDENT>line = f.readline()<EOL>m = r.match(line)<EOL>if m is None:<EOL><INDENT>cnt += <NUM_LIT:1><EOL>time.sleep(<NUM_LIT:1>)<EOL><DEDENT>else:<EOL><INDENT>port = int(m.group('<STR_LIT:port>'))<EOL>return port<EOL><DEDENT><DEDENT>else:<EOL><INDENT>logger.warning('<STR_LIT>')<EOL>return None<EOL><DEDENT><DEDENT>
Searching for line in jmeter.log such as
        Waiting for possible shutdown message on port 4445