Bug 999071 - Empty ANR file during testing instead of deleting it; r=gbrown
authorJim Chen <nchen@mozilla.com>
Mon, 28 Apr 2014 22:20:52 -0400
changeset 181053 77ed9758681b101e3a889a7712a1d083013c9360
parent 181052 b4d1efedb68f041639da29de80403a728eeafb3c
child 181054 267b32d6633fda3f372bf59e819103ca982c3c68
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersgbrown
bugs999071
milestone32.0a1
Bug 999071 - Empty ANR file during testing instead of deleting it; r=gbrown
build/mobile/remoteautomation.py
--- a/build/mobile/remoteautomation.py
+++ b/build/mobile/remoteautomation.py
@@ -93,20 +93,22 @@ class RemoteAutomation(Automation):
                       "allowed maximum time" % (self.lastTestSeen)
         if status == 2:
             print "TEST-UNEXPECTED-FAIL | %s | application timed out after %d seconds with no output" \
                 % (self.lastTestSeen, int(timeout))
 
         return status
 
     def deleteANRs(self):
-        # delete ANR traces.txt file; usually need root permissions
+        # empty ANR traces.txt file; usually need root permissions
+        # we make it empty and writable so we can test the ANR reporter later
         traces = "/data/anr/traces.txt"
         try:
-            self._devicemanager.shellCheckOutput(['rm', traces], root=True)
+            self._devicemanager.shellCheckOutput(['echo', '', '>', traces], root=True)
+            self._devicemanager.shellCheckOutput(['chmod', '666', traces], root=True)
         except DMError:
             print "Error deleting %s" % traces
             pass
 
     def checkForANRs(self):
         traces = "/data/anr/traces.txt"
         if self._devicemanager.fileExists(traces):
             try: