Be more aggressive about killing the rpc server.
I don't know why the rpc server doesn't always exit, but
running kill again with -9 makes sure it goes away.
BUG=b:178559632
TEST=Ran firmware_ECChargingState many times.
Change-Id: I792401635a982d6950fa4e681473681be4709530
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2681126
Reviewed-by: Kevin Shelton <kmshelton@chromium.org>
Tested-by: Jeremy Bettis <jbettis@chromium.org>
Tested-by: Bob Moragues <moragues@chromium.org>
Commit-Queue: Bob Moragues <moragues@chromium.org>
diff --git a/server/hosts/rpc_server_tracker.py b/server/hosts/rpc_server_tracker.py
index 0fc50af..b48271b 100644
--- a/server/hosts/rpc_server_tracker.py
+++ b/server/hosts/rpc_server_tracker.py
@@ -321,8 +321,8 @@
# status.
self._host.run("pkill -f '%s'" % remote_name, ignore_status=True)
if remote_pid:
- logging.info('Waiting for RPC server "%s" shutdown',
- remote_name)
+ logging.info('Waiting for RPC server "%s" shutdown (%s)',
+ remote_name, remote_pid)
start_time = time.time()
while (time.time() - start_time <
self._RPC_SHUTDOWN_TIMEOUT_SECONDS):
@@ -330,9 +330,11 @@
"pgrep -f '%s'" % remote_name,
ignore_status=True).stdout.split()
if not remote_pid in running_processes:
- logging.info('Shut down RPC server.')
+ logging.info('Shut down RPC server %s.', remote_pid)
break
time.sleep(self._RPC_SHUTDOWN_POLLING_PERIOD_SECONDS)
+ self._host.run("pkill -9 -f '%s'" % remote_name,
+ ignore_status=True)
else:
raise error.TestError('Failed to shutdown RPC server %s' %
remote_name)