Bug 999071 - Empty ANR file during testing instead of deleting it; r=gbrown
☠☠ backed out by d83cad7c5853 ☠ ☠
authorJim Chen <nchen@mozilla.com>
Thu, 24 Apr 2014 17:49:02 -0400
changeset 180456 8d2738b2227522649c54859249c23561051e07b0
parent 180455 b82a8c50aa904edada187a844e21f8dc9d96e955
child 180457 ddf970be0abd398b2c6bc0e5a2c7152e387fbbd6
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersgbrown
bugs999071
milestone31.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: