Commit 77070abf authored by Kartikaya Gupta's avatar Kartikaya Gupta
Browse files

Bug 1555410 - Clear the logcat before starting to record. r=gbrown

This allows local runs where the emulator stays up between runs to have
a cleaner logcat, because it won't pull historical logcat from the emulator.

Differential Revision: https://phabricator.services.mozilla.com/D33038

--HG--
extra : moz-landing-system : lando
parent c47338e8
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@

import datetime
import os
import subprocess
import sys
import time

@@ -57,6 +58,15 @@ class AndroidEmulatorWrench(TestingMixin, BaseScript, MozbaseMixin, AndroidMixin
        self.abs_dirs = abs_dirs
        return self.abs_dirs

    def logcat_start(self):
        """Overrides logcat_start in android.py - ensures any pre-existing logcat
           is cleared before starting to record the new logcat. This is helpful
           when running multiple times in a local emulator."""
        logcat_cmd = [self.adb_path, '-s', self.device_serial, 'logcat', '-c']
        self.info(' '.join(logcat_cmd))
        subprocess.check_call(logcat_cmd)
        super(AndroidEmulatorWrench, self).logcat_start()

    def wait_until_process_done(self, process_name, timeout):
        """Waits until the specified process has exited. Polls the process list
            every 5 seconds until the process disappears.