path: mozjs140_140.8.0-2/testing/mozbase/mozdevice/mozdevice/adb.py except ADBError as e: if "not found" in str(e): self._have_pidof = False boot_completed = True elif "known option" in str(e): path: mozjs140_140.8.0-2/testing/mozbase/mozdevice/mozdevice/adb.py if self._have_pidof: try: pid_output = self.shell_output("pidof %s" % app_name, timeout=timeout) re_pids = re.compile(r"[0-9]+") pids = re_pids.findall(pid_output) path: mozjs140_140.8.0-2/testing/mozbase/mozdevice/mozdevice/adb.py self._logger.debug("Check for root adbd failed") def pidof(self, app_name, timeout=None): """ Return a list of pids for all extant processes running within the path: mozjs140_140.8.0-2/testing/mozbase/mozdevice/mozdevice/adb.py self._logger.info( "Native {} pidof support: {}".format( "flaky" if self._have_flaky_pidof else "normal", self._have_pidof ) ) path: mozjs140_140.8.0-2/testing/mozbase/mozdevice/mozdevice/adb.py ) self._logger.info( "Native {} pidof support: {}".format( "flaky" if self._have_flaky_pidof else "normal", self._have_pidof ) path: mozjs140_140.8.0-2/testing/mozbase/mozdevice/mozdevice/adb.py self.shell_output("pidof --help", timeout=timeout) boot_completed = True self._have_pidof = True except ADBError as e: if "not found" in str(e): path: mozjs140_140.8.0-2/testing/mozbase/mozdevice/mozdevice/adb.py # Do we have pidof? if self.version < version_codes.N: # unexpected pidof behavior observed on Android 6 in bug 1514363 self._have_pidof = False else: path: mozjs140_140.8.0-2/testing/mozbase/mozdevice/mozdevice/adb.py :raises: :exc:`ADBTimeoutError` """ if self._have_pidof: try: pid_output = self.shell_output("pidof %s" % app_name, timeout=timeout) path: mozjs140_140.8.0-2/testing/mozbase/mozdevice/mozdevice/adb.py while not boot_completed and (time.time() - start_time) <= float(timeout): try: self.shell_output("pidof --help", timeout=timeout) boot_completed = True self._have_pidof = True path: mozjs140_140.8.0-2/testing/mozbase/mozdevice/mozdevice/adb.py if self.version < version_codes.N: # unexpected pidof behavior observed on Android 6 in bug 1514363 self._have_pidof = False else: boot_completed = False path: mozjs140_140.8.0-2/testing/mozbase/mozdevice/mozdevice/adb.py abi = self.get_prop("ro.product.cpu.abi", timeout=timeout) self._have_flaky_pidof = ( self.version == version_codes.N and abi == "x86_64" path: mozjs140_140.8.0-2/testing/mozbase/mozdevice/mozdevice/adb.py app = parts[-1] if self.pidof(app, timeout=timeout): return True return False path: mozjs140_140.8.0-2/testing/mozbase/mozdevice/mozdevice/adb.py if not boot_completed: raise ADBTimeoutError("ADBDevice: pidof not found.") # Bug 1529960 observed pidof intermittently returning no results for a # running process on the 7.0 x86_64 emulator. path: mozjs140_140.8.0-2/testing/mozbase/mozdevice/mozdevice/adb.py self._logger.info("Unable to turn off logcat chatty") # Do we have pidof? if self.version < version_codes.N: # unexpected pidof behavior observed on Android 6 in bug 1514363 path: mozjs140_140.8.0-2/testing/mozbase/mozdevice/mozdevice/adb.py time.sleep(2) if not boot_completed: raise ADBTimeoutError("ADBDevice: pidof not found.") # Bug 1529960 observed pidof intermittently returning no results for a # running process on the 7.0 x86_64 emulator. path: mozjs140_140.8.0-2/testing/mozbase/mozdevice/mozdevice/adb.py re_pids = re.compile(r"[0-9]+") pids = re_pids.findall(pid_output) if self._have_flaky_pidof and not pids: time.sleep(0.1) pid_output = self.shell_output( path: mozjs140_140.8.0-2/testing/mozbase/mozdevice/mozdevice/adb.py time.sleep(0.1) pid_output = self.shell_output( "pidof %s" % app_name, timeout=timeout ) pids = re_pids.findall(pid_output) path: mozjs140_140.8.0-2/testing/mozbase/mozdevice/mozdevice/adb.py boot_completed = True elif "known option" in str(e): self._have_pidof = True boot_completed = True if not boot_completed: path: mozjs140_140.8.0-2/testing/mozbase/mozdevice/mozdevice/adb.py :exc:`ADBError` """ pids = self.pidof(appname, timeout=timeout) if not pids: path: mozjs140_140.8.0-2/python/mozbuild/mozbuild/mach_commands.py # We're not using an existing process, so there should only be our # parent process at this time. pids = device.pidof(app_name=metadata.package_name) if len(pids) != 1: command_context.log(