Bug 1098529 - Properly handle devicemanager exceptions in jittests; r=terrence
authorDan Minor <dminor@mozilla.com>
Thu, 13 Nov 2014 15:19:06 -0500
changeset 239270 93640018725d4cf803b68f7230f7afe13d2377fb
parent 239269 f34d4207cb44921ee4ecf6237bbbc506b480ba53
child 239271 f6a498e8283102617e2f45d975a1882fe625a2aa
push id7472
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 20:36:27 +0000
treeherdermozilla-aurora@300ca104f8fb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs1098529
milestone37.0a1
Bug 1098529 - Properly handle devicemanager exceptions in jittests; r=terrence
js/src/tests/lib/jittests.py
--- a/js/src/tests/lib/jittests.py
+++ b/js/src/tests/lib/jittests.py
@@ -698,19 +698,27 @@ def get_serial_results(tests, prefix, op
             yield run_test(test, prefix, options)
 
 def run_tests(tests, prefix, options):
     gen = get_serial_results(tests, prefix, options)
     ok = process_test_results(gen, len(tests) * options.repeat, options)
     return ok
 
 def get_remote_results(tests, device, prefix, options):
-    for i in xrange(0, options.repeat):
-        for test in tests:
-            yield run_test_remote(test, device, prefix, options)
+    from mozdevice import devicemanager
+
+    try:
+        for i in xrange(0, options.repeat):
+            for test in tests:
+                yield run_test_remote(test, device, prefix, options)
+    except devicemanager.DMError as e:
+        # After a devicemanager error, the device is typically in a
+        # state where all further tests will fail so there is no point in
+        # continuing here.
+        sys.stderr.write("Error running remote tests: %s" % e.message)
 
 def push_libs(options, device):
     # This saves considerable time in pushing unnecessary libraries
     # to the device but needs to be updated if the dependencies change.
     required_libs = ['libnss3.so', 'libmozglue.so', 'libnspr4.so', 'libplc4.so', 'libplds4.so']
 
     for file in os.listdir(options.local_lib):
         if file in required_libs: