mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
b=414049 dump screen on first mochitest time out (GTK) r=ted a=testing
--HG-- extra : rebase_source : bc550d298019baa44f719cdd2b88181ac9c670eb
This commit is contained in:
parent
8c69ee3b3b
commit
35de8505a4
@ -159,6 +159,7 @@ class Automation(object):
|
||||
def __init__(self):
|
||||
self.log = _log
|
||||
self.lastTestSeen = "automation.py"
|
||||
self.haveDumpedScreen = False
|
||||
|
||||
def setServerInfo(self,
|
||||
webServer = _DEFAULT_WEB_SERVER,
|
||||
@ -655,8 +656,34 @@ user_pref("camino.use_system_proxy_settings", false); // Camino-only, harmless t
|
||||
def killPid(self, pid):
|
||||
os.kill(pid, signal.SIGKILL)
|
||||
|
||||
if UNIXISH:
|
||||
def dumpScreen(self, utilityPath):
|
||||
self.haveDumpedScreen = True;
|
||||
|
||||
screentopng = os.path.join(utilityPath, "screentopng")
|
||||
try:
|
||||
dumper = self.Process([screentopng], bufsize=-1,
|
||||
stdout=subprocess.PIPE, close_fds=True)
|
||||
except OSError, err:
|
||||
self.log.info("Failed to start %s for screenshot: %s",
|
||||
screentopng, err.strerror)
|
||||
return
|
||||
|
||||
image = dumper.stdout.read()
|
||||
status = dumper.wait()
|
||||
if status != 0:
|
||||
self.log.info("screentopng exited with code %d", status)
|
||||
return
|
||||
|
||||
import base64
|
||||
encoded = base64.b64encode(image)
|
||||
self.log.info("SCREENSHOT: data:image/png;base64,%s", encoded)
|
||||
|
||||
def killAndGetStack(self, proc, utilityPath, debuggerInfo):
|
||||
"""Kill the process, preferrably in a way that gets us a stack trace."""
|
||||
if self.UNIXISH and not debuggerInfo and not self.haveDumpedScreen:
|
||||
self.dumpScreen(utilityPath)
|
||||
|
||||
if self.CRASHREPORTER and not debuggerInfo:
|
||||
if self.UNIXISH:
|
||||
# ABRT will get picked up by Breakpad's signal handler
|
||||
@ -710,6 +737,9 @@ user_pref("camino.use_system_proxy_settings", false); // Camino-only, harmless t
|
||||
if stackFixerFunction:
|
||||
line = stackFixerFunction(line)
|
||||
self.log.info(line.rstrip())
|
||||
if self.UNIXISH and not debuggerInfo and not self.haveDumpedScreen and "TEST-UNEXPECTED-FAIL" in line and "Test timed out." in line:
|
||||
self.dumpScreen(utilityPath)
|
||||
|
||||
(line, didTimeout) = self.readWithTimeout(logsource, timeout)
|
||||
if not hitMaxTime and maxTime and datetime.now() - startTime > timedelta(seconds = maxTime):
|
||||
# Kill the application, but continue reading from stack fixer so as not to deadlock on stackFixerProcess.wait().
|
||||
|
@ -145,6 +145,10 @@ ifeq ($(OS_ARCH),Linux)
|
||||
TEST_HARNESS_BINS += fix-linux-stack.pl
|
||||
endif
|
||||
|
||||
ifeq (gtk2_1,$(MOZ_WIDGET_TOOLKIT)_$(MOZ_X11))
|
||||
TEST_HARNESS_BINS += screentopng
|
||||
endif
|
||||
|
||||
# Components / typelibs that don't get packaged with
|
||||
# the build, but that we need for the test harness.
|
||||
TEST_HARNESS_COMPONENTS := \
|
||||
|
Loading…
Reference in New Issue
Block a user