Merge pull request #160 from vbanos/behavior-timeout

More accurate JS behavior timeout
This commit is contained in:
Noah Levitt 2019-09-24 12:11:37 -07:00 committed by GitHub
commit efa185a8dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -617,6 +617,7 @@ class Browser:
method='Runtime.evaluate', suppress_logging=True,
params={'expression': behavior_script})
check_interval = min(timeout, 7)
start = time.time()
while True:
elapsed = time.time() - start
@ -625,7 +626,7 @@ class Browser:
'behavior reached hard timeout after %.1fs', elapsed)
return
brozzler.sleep(7)
brozzler.sleep(check_interval)
self.websock_thread.expect_result(self._command_id.peek())
msg_id = self.send_to_chrome(