It should be possible to run Android telemetry tests without rooting the device first. |
||||||||||
Issue description
While attempting to run Android telemetry tests locally (on a Nexus 5X), I encountered the following output, which says I must root the device first. This seems like an unnecessary obstacle for developers to be able to test locally.
tools/perf/run_benchmark --device=00f058be10b546ac smoothness.sync_scroll.key_mobile_sites_smooth
(CRITICAL) 2018-03-27 09:58:16,105 timeout_retry.Run:173 (TimeoutThread-1-for-MainThread) Exception on EnableRoot(00f058be10b546ac, retries=3, timeout=30), attempt 1 of 4: CommandFailedError('(device: 00f058be10b546ac) Unable to root device with user build.',)
(CRITICAL) 2018-03-27 09:58:16,222 timeout_retry.Run:173 (TimeoutThread-2-for-MainThread) Exception on EnableRoot(00f058be10b546ac, retries=3, timeout=30), attempt 2 of 4: CommandFailedError('(device: 00f058be10b546ac) Unable to root device with user build.',)
(CRITICAL) 2018-03-27 09:58:16,323 timeout_retry.Run:173 (TimeoutThread-3-for-MainThread) Exception on EnableRoot(00f058be10b546ac, retries=3, timeout=30), attempt 3 of 4: CommandFailedError('(device: 00f058be10b546ac) Unable to root device with user build.',)
(WARNING) 2018-03-27 09:58:16,440 android_platform_backend.__init__:79 Unable to root 00f058be10b546ac
(ERROR) 2018-03-27 09:58:16,642 platform.GetPlatformForDevice:68 Fail to create platform instance for Android device 00f058be10b546ac.
Traceback (most recent call last):
<module> at /usr/local/google_ssd/projects/chromium/src/tools/perf/run_benchmark:27
sys.exit(main())
main at /usr/local/google_ssd/projects/chromium/src/tools/perf/run_benchmark:23
return benchmark_runner.main(config, [trybot_command.Trybot])
main at /usr/local/google_ssd/projects/chromium/src/third_party/catapult/telemetry/telemetry/benchmark_runner.py:405
return command_instance.Run(options)
Run at /usr/local/google_ssd/projects/chromium/src/third_party/catapult/telemetry/telemetry/benchmark_runner.py:275
return min(255, b.Run(args))
Run at /usr/local/google_ssd/projects/chromium/src/third_party/catapult/telemetry/telemetry/benchmark.py:100
return story_runner.RunBenchmark(self, finder_options)
RunBenchmark at /usr/local/google_ssd/projects/chromium/src/third_party/catapult/telemetry/telemetry/internal/story_runner.py:293
benchmark.CustomizeBrowserOptions(finder_options.browser_options)
CustomizeBrowserOptions at /usr/local/google_ssd/projects/chromium/src/tools/perf/core/perf_benchmark.py:40
variations = self._GetVariationsBrowserArgs(options.finder_options)
_GetVariationsBrowserArgs at /usr/local/google_ssd/projects/chromium/src/tools/perf/core/perf_benchmark.py:57
possible_browser = browser_finder.FindBrowser(finder_options)
Cacher at /usr/local/google_ssd/projects/chromium/src/third_party/catapult/telemetry/telemetry/decorators.py:35
cacher.__cache[key] = obj(*args, **kwargs)
FindBrowser at /usr/local/google_ssd/projects/chromium/src/third_party/catapult/telemetry/telemetry/internal/browser/browser_finder.py:69
curr_browsers = finder.FindAllAvailableBrowsers(options, device)
FindAllAvailableBrowsers at /usr/local/google_ssd/projects/chromium/src/third_party/catapult/telemetry/telemetry/internal/backends/chrome/android_browser_finder.py:343
android_platform = platform.GetPlatformForDevice(device, finder_options)
GetPlatformForDevice at /usr/local/google_ssd/projects/chromium/src/third_party/catapult/telemetry/telemetry/core/platform.py:63
finder_options))
CreatePlatformForDevice at /usr/local/google_ssd/projects/chromium/src/third_party/catapult/telemetry/telemetry/internal/platform/android_platform_backend.py:118
platform_backend = AndroidPlatformBackend(device)
__init__ at /usr/local/google_ssd/projects/chromium/src/third_party/catapult/telemetry/telemetry/internal/platform/android_platform_backend.py:81
'Android device must be rooted to run Telemetry')
AssertionError: Android device must be rooted to run Telemetry
Locals:
device : <telemetry.internal.platform.android_device.AndroidDevice object at 0x7f59559ae710>
,
Mar 27 2018
This wasn't the case a few years ago, right? What changed? This means that we can't run benchmarks on phones we can't root, which is a shame. I think +flackr@ had some use case here as well?
,
Mar 27 2018
#2: I recall it has something to do with the tighten security model on newer version of Android. John & JUan can fill in some details as well
,
Apr 4 2018
There are quite a few places where we run commands as_root on the device. Some quickly hacked regex shows: https://cs.chromium.org/search/?q=file:catapult/(devil%7Ctelemetry)+-file:device_utils(_test)?%5C.py+as_root%3DTrue+-file:%5Esrc/third_party/android_tools+-file:%5Einfra/infra/services/android_docker&type=cs Supporting non-rooted devices would require some significant work, going through these and figure out whether workarounds (or "graceful degradation") would work for non-rooted devices. (And probably running some non-rooted devices on the waterfall, to prevent us from regressing this use case.) The couple of things that jump out to me as potential blockers are those related to chrome tracing settings.
,
Apr 4 2018
,
Aug 8
Reopening, because per comments on https://chromium-review.googlesource.com/1165238, the Telemetry team is open to this idea. +ynovikov as we want to put non-rootable Android devices on the chromium.gpu.fyi waterfall. Should this be upgraded to a P1 RFE?
,
Aug 20
It's not possible to bisect bugs like Issue 868679 -- which are happening on non-rootable devices -- without this being fixed. Raising this to a P1 RFE.
,
Aug 20
kainino@ pointed out to me that the Chrome-internal per-revision bisect script works with non-rootable phones as long as no command line arguments (including the URL to navigate to) are specified. That helps. Running Telemetry on non-rootable devices should still be officially supported.
,
Oct 24
Re-raising this to P1 RFE because the inability to run the GPU tests against arbitrary phones is a constant source of difficulty. Could we please add a flag to Telemetry to just skip its initialization steps which require root? (Making these silently fail is probably not a good idea.)
,
Oct 25
,
Jan 16
(6 days ago)
,
Jan 16
(6 days ago)
|
||||||||||
►
Sign in to add a comment |
||||||||||
Comment 1 by nednguyen@chromium.org
, Mar 27 2018