Now ignoring adb shell service return error code in acov-llvm.py

Bug: 261529166

Ignore failures when sending the flush signal.  Some processes may have
exited after we run `adb shell ps` but before we could send the flush signal.

Test: Successful run of coverage metrics using acov-llvm (as documented in go/android-native-coverage-local-workflow

Change-Id: I2fc0f71bf5f6d810b4124e28d7dd69ebfc2579b3
Signed-off-by: Shaju Mathew <shaju@google.com>
This commit is contained in:
Shaju Mathew
2022-12-05 20:02:49 -08:00
committed by Pirama Arumuga Nainar
parent 92c1be2a08
commit 91f544f227

View File

@@ -125,7 +125,15 @@ def send_flush_signal(pids=None):
logging.warning(
f'couldn\'t find any process with handler for signal 37')
# Some processes may have exited after we run `ps` command above - ignore failures when
# sending flush signal.
# We rely on kill(1) sending the signal to all pids on the command line even if some don't
# exist. This is true of toybox and "probably implied" by POSIX, even if not explicitly called
# out [https://pubs.opengroup.org/onlinepubs/9699919799/utilities/kill.html].
try:
adb_shell(['kill', '-37'] + pids)
except subprocess.CalledProcessError:
logging.warning('Sending flush signal failed - some pids no longer active')
def do_clean_device(args):