mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-02-24 00:29:53 -05:00
Merge pull request #160 from vbanos/behavior-timeout
More accurate JS behavior timeout
This commit is contained in:
commit
efa185a8dc
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user