From fa6e3eebb2dbf2f8722921b6076074d1ecaaa3ae Mon Sep 17 00:00:00 2001 From: Noah Levitt Date: Mon, 5 May 2014 18:37:39 -0700 Subject: [PATCH] clear UmbraWorker.self._behavior when finished with a page (after the first page, nothing was getting behaviors); bump hard timeout to 20 minutes --- umbra/umbra.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/umbra/umbra.py b/umbra/umbra.py index 2d141f1..e197921 100755 --- a/umbra/umbra.py +++ b/umbra/umbra.py @@ -30,7 +30,7 @@ class UmbraWorker: future, it may keep the browser running indefinitely.)""" logger = logging.getLogger('umbra.UmbraWorker') - HARD_TIMEOUT_SECONDS = 60 * 15 + HARD_TIMEOUT_SECONDS = 20 * 60 def __init__(self, umbra, chrome_port=9222, chrome_exe='chromium-browser', chrome_wait=10, client_id='request'): self.command_id = itertools.count(1) @@ -75,6 +75,7 @@ class UmbraWorker: self.logger.error("exception closing websocket {} - {}".format(self.websock, e)) websock_thread.join() + self._behavior = None def send_to_chrome(self, **kwargs): msg_id = next(self.command_id) @@ -128,7 +129,7 @@ class UmbraWorker: else: self.logger.warn("Page.loadEventFired but behaviors already running url={} message={}".format(self.url, message)) elif "method" in message and message["method"] == "Console.messageAdded": - self.logger.debug("{} console {} {}".format(websock.url, + self.logger.debug("{} console.{} {}".format(websock.url, message["params"]["message"]["level"], message["params"]["message"]["text"])) elif "method" in message and message["method"] == "Debugger.paused":