From cfcccf314d6ebd2d641205684ad4c69cba741789 Mon Sep 17 00:00:00 2001 From: Snild Dolkow Date: Wed, 23 Sep 2020 10:34:03 +0200 Subject: Disable compression in AdbPull() Compression makes adb pull slower, enough to make the /vendor pull in vts_vndk_dependency_test time out on some devices. Commit I9ed6f37bc55b1d55ae7c0c29a70a0e79b91ff683 updates the default for adb pull, but VTS may run with an older version. Setting the ADB_COMPRESSION environment variable to 0 will disable compression for all versions supporting it, and does no harm otherwise. This change takes vts_vndk_dependency_test from 396 to 181 seconds on my device, allowing it to finish within the 6-minute deadline. Change-Id: Ic0a5e5e5ac07a78f593619487c66376ab1a417df --- utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils.py b/utils.py index 5fae388..8bf00f3 100644 --- a/utils.py +++ b/utils.py @@ -32,7 +32,10 @@ class AndroidDevice(object): def AdbPull(self, src, dst): cmd = ["adb", "-s", self._serial_number, "pull", src, dst] - subprocess.check_call(cmd, shell=False, stdin=subprocess.PIPE, + env = os.environ.copy() + if "ADB_COMPRESSION" not in env: + env["ADB_COMPRESSION"] = "0" + subprocess.check_call(cmd, shell=False, env=env, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) def Execute(self, *args): -- cgit v1.2.3