Bug 999071 - Empty ANR file during testing instead of deleting it. r=gbrown, a=sledru
authorJim Chen <nchen@mozilla.com>
Mon, 28 Apr 2014 22:20:52 -0400
changeset 199038 36532bdbbc5c36b756af3a74790c77aa8b8490f8
parent 199037 95b027dc3cf99e0a989842629f249dfa624293a6
child 199039 1ff7a95509f9a80b9a7eea4a56fc18dcccfec89c
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgbrown, sledru
bugs999071
milestone31.0a2
Bug 999071 - Empty ANR file during testing instead of deleting it. r=gbrown, a=sledru
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: