author | Sam Sneddon <me@gsnedders.com> |
Wed, 28 Aug 2019 09:54:00 +0000 | |
changeset 490703 | a40980e4179ab2459051ceedfe0d08c091c6fda4 |
parent 490702 | 46ce1c209c17ce99f3090d6dbe179e018424fea7 |
child 490704 | 1cd8c72bcdebe21f24f4d24a5d4350a62beaa6e1 |
push id | 36509 |
push user | csabou@mozilla.com |
push date | Thu, 29 Aug 2019 21:46:56 +0000 |
treeherder | mozilla-central@5c424bc57454 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | testonly |
bugs | 1576220, 18642 |
milestone | 70.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executorwebdriver.py +++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executorwebdriver.py @@ -1,11 +1,12 @@ import json import os import socket +import sys import threading import time import traceback import urlparse import uuid from .base import (CallbackHandler, RefTestExecutor, @@ -227,20 +228,24 @@ class WebDriverProtocol(Protocol): capabilities = {"alwaysMatch": self.capabilities} self.webdriver = client.Session(host, port, capabilities=capabilities) self.webdriver.start() def teardown(self): self.logger.debug("Hanging up on WebDriver session") try: - self.webdriver.quit() - except Exception: - pass - del self.webdriver + self.webdriver.end() + except Exception as e: + message = str(getattr(e, "message", "")) + if message: + message += "\n" + message += traceback.format_exc(e) + self.logger.debug(message) + self.webdriver = None def is_alive(self): try: # Get a simple property over the connection self.webdriver.window_handle except (socket.timeout, client.UnknownErrorException): return False return True @@ -272,17 +277,20 @@ class WebDriverRun(object): flag = self.result_flag.wait(timeout + 2 * extra_timeout) if self.result is None: if flag: # flag is True unless we timeout; this *shouldn't* happen, but # it can if self._run fails to set self.result due to raising self.result = False, ("INTERNAL-ERROR", "self._run didn't set a result") else: - self.result = False, ("EXTERNAL-TIMEOUT", None) + message = "Waiting on browser:\n" + # get a traceback for the current stack of the executor thread + message += "".join(traceback.format_stack(sys._current_frames()[executor.ident])) + self.result = False, ("EXTERNAL-TIMEOUT", message) return self.result def _run(self): try: self.result = True, self.func(self.protocol, self.url, self.timeout) except (client.TimeoutException, client.ScriptTimeoutException): self.result = False, ("EXTERNAL-TIMEOUT", None)
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/webdriver_server.py +++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/webdriver_server.py @@ -76,16 +76,17 @@ class WebDriverServer(object): "WebDriver was not accessible " "within the timeout:\n%s" % traceback.format_exc()) raise if block: self._proc.wait() def stop(self, force=False): + self.logger.debug("Stopping WebDriver") if self.is_alive: return self._proc.kill() return not self.is_alive @property def is_alive(self): return hasattr(self._proc, "proc") and self._proc.poll() is None