Bug 1015178 - Implement kill and get stack for b2g reftests, r=wlach
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Wed, 28 May 2014 09:00:36 -0400
changeset 185359 33a2a8aaed24e7d9a60419d6d6073b2740ff8b9f
parent 185358 2dde931a80349a5ea1d9192c746b154889ed4205
child 185360 9c2a53b41ba8303a274e3a340b1c67f3411d66bd
push id26849
push userryanvm@gmail.com
push dateWed, 28 May 2014 20:17:32 +0000
treeherdermozilla-central@4b59c0435b6e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswlach
bugs1015178
milestone32.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
Bug 1015178 - Implement kill and get stack for b2g reftests, r=wlach
build/mobile/b2gautomation.py
--- a/build/mobile/b2gautomation.py
+++ b/build/mobile/b2gautomation.py
@@ -1,19 +1,21 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
+import datetime
 import mozcrash
 import threading
 import os
 import posixpath
 import Queue
 import re
 import shutil
+import signal
 import tempfile
 import time
 import traceback
 
 from automation import Automation
 from mozprocess import ProcessHandlerMixin
 
 
@@ -147,16 +149,29 @@ class B2GRemoteAutomation(Automation):
                 if testStartFilenames:
                     self.lastTestSeen = testStartFilenames[-1]
                 if hasattr(self, 'logFinish') and self.logFinish in currentlog:
                     return 0
             else:
                 self.log.info("TEST-UNEXPECTED-FAIL | %s | application timed "
                               "out after %d seconds with no output",
                               self.lastTestSeen, int(timeout))
+                self._devicemanager.killProcess('/system/b2g/b2g', sig=signal.SIGABRT)
+
+                timeout = 10 # seconds
+                starttime = datetime.datetime.now()
+                while datetime.datetime.now() - starttime < datetime.timedelta(seconds=timeout):
+                    if not self._devicemanager.processExist('/system/b2g/b2g'):
+                        break
+                    time.sleep(1)
+                else:
+                    print "timed out after %d seconds waiting for b2g process to exit" % timeout
+                    return 1
+
+                self.checkForCrashes(None, symbolsPath)
                 return 1
 
     def getDeviceStatus(self, serial=None):
         # Get the current status of the device.  If we know the device
         # serial number, we look for that, otherwise we use the (presumably
         # only) device shown in 'adb devices'.
         serial = serial or self._devicemanager._deviceSerial
         status = 'unknown'