Android test runner shouldn't redirect stdout to /sdcard/. ReadFileWithPull fails with ENOPERM -> NoDevicesError: No devices attached |
|||
Issue description
I was trying to use out/droid/bin/run_tracing_perftests (tracing_perftests is irrelevent here IMHO) and it failed with the error below
The error is very misleading (no devices attached) and I think this is just the wrapper script not being able to detect the real error, which is this:
01-13 21:48:55.098 20179 20179 E chromium: Failed to redirect stream to file: /sdcard/temp_file-95a99f7a9efde.gtest_out: Permission denied
In fact you see in the stacktrace below that ReadFileWithPull failed (before falsely blaming the device).
The device is rooted and I did setenforce 0 (disable selinux), but didn't help.
The device is a N5 @ google/hammerhead/hammerhead:6.0/MRA59G/2457013:userdebug/dev-keys
Error:
$ out/offdroid/bin/run_tracing_perftests -v --adb-path $(which adb)
I 0.000s Main command: /s/chrome/src/build/android/test_runner.py gtest --suite tracing_perftests --output-directory /s/chrome/src/out/offdroid --runtime-deps-path /s/chrome/src/out/offdroid/gen.runtime/components/tracing/tracing_perftests__test_runner_script.runtime_deps -v --adb-path /usr/local/google/home/primiano/tools/android-sdk/platform-tools//adb
I 0.007s Main [host]> /s/chrome/src/third_party/android_tools/sdk/build-tools/25.0.2/aapt dump xmltree /s/chrome/src/out/offdroid/tracing_perftests_apk/tracing_perftests-debug.apk AndroidManifest.xml
I 0.027s TimeoutThread-1-for-MainThread [host]> /usr/local/google/home/primiano/tools/android-sdk/platform-tools/adb devices
I 0.059s TimeoutThread-1-for-prepare_device(02fb28b221082ede) [host]> /usr/local/google/home/primiano/tools/android-sdk/platform-tools/adb -s 02fb28b221082ede wait-for-device
I 0.092s TimeoutThread-1-for-prepare_device(02fb28b221082ede) [host]> /usr/local/google/home/primiano/tools/android-sdk/platform-tools/adb -s 02fb28b221082ede shell '( ( c=/data/local/tmp/cache_token;echo $EXTERNAL_STORAGE;cat $c 2>/dev/null||echo;echo "037981ea-5010-11e7-8342-a0481c90234a">$c &&getprop )>/data/local/tmp/temp_file-3dbe8ec4af12d );echo %$?'
I 0.146s TimeoutThread-1-for-prepare_device(02fb28b221082ede) [host]> /usr/local/google/home/primiano/tools/android-sdk/platform-tools/adb -s 02fb28b221082ede pull /data/local/tmp/temp_file-3dbe8ec4af12d /tmp/tmpoI_YvU/tmp_ReadFileWithPull
I 0.204s TimeoutThread-1-for-prepare_device(02fb28b221082ede) [host]> /usr/local/google/home/primiano/tools/android-sdk/platform-tools/adb -s 02fb28b221082ede shell '( test -d /sdcard );echo %$?'
I 0.204s TimeoutThread-1-for-delete_temporary_file(02fb28b221082ede) [host]> /usr/local/google/home/primiano/tools/android-sdk/platform-tools/adb -s 02fb28b221082ede shell 'rm -f /data/local/tmp/temp_file-3dbe8ec4af12d'
I 0.239s TimeoutThread-1-for-prepare_device(02fb28b221082ede) condition 'sd_card_ready' met (0.2s)
I 0.239s TimeoutThread-1-for-prepare_device(02fb28b221082ede) [host]> /usr/local/google/home/primiano/tools/android-sdk/platform-tools/adb -s 02fb28b221082ede shell '( pm path android );echo %$?'
I 1.423s TimeoutThread-1-for-prepare_device(02fb28b221082ede) condition 'pm_ready' met (1.4s)
I 1.423s TimeoutThread-1-for-prepare_device(02fb28b221082ede) [host]> /usr/local/google/home/primiano/tools/android-sdk/platform-tools/adb -s 02fb28b221082ede shell '( getprop sys.boot_completed );echo %$?'
I 1.472s TimeoutThread-1-for-prepare_device(02fb28b221082ede) condition 'boot_completed' met (1.4s)
I 1.495s TimeoutThread-1-for-individual_device_set_up(02fb28b221082ede) [host]> /usr/local/google/home/primiano/tools/android-sdk/platform-tools/adb -s 02fb28b221082ede shell '( pm path org.chromium.native_test );echo %$?'
I 2.622s calculate_device_checksums [host]> /usr/local/google/home/primiano/tools/android-sdk/platform-tools/adb -s 02fb28b221082ede shell '( a=/data/local/tmp/md5sum/md5sum_bin;! [[ $(ls -l $a) = *251512* ]]&&exit 2;export LD_LIBRARY_PATH=/data/local/tmp/md5sum;$a /data/app/org.chromium.native_test-1/base.apk;: );echo %$?'
I 2.623s calculate_host_checksums [host]> /s/chrome/src/out/offdroid/md5sum_bin_host /s/chrome/src/out/offdroid/tracing_perftests_apk/tracing_perftests-debug.apk
I 2.754s TimeoutThread-1-for-individual_device_set_up(02fb28b221082ede) [host]> /usr/local/google/home/primiano/tools/android-sdk/platform-tools/adb -s 02fb28b221082ede shell '( ps | grep -F org.chromium.native_test; echo "PIPESTATUS: ${PIPESTATUS[@]}" );echo %$?'
I 2.863s calculate_device_checksums [host]> /usr/local/google/home/primiano/tools/android-sdk/platform-tools/adb -s 02fb28b221082ede shell '( a=/data/local/tmp/md5sum/md5sum_bin;! [[ $(ls -l $a) = *251512* ]]&&exit 2;export LD_LIBRARY_PATH=/data/local/tmp/md5sum;$a /sdcard/chromium_tests_root/icudtl.dat;: );echo %$?'
I 2.863s calculate_host_checksums [host]> /s/chrome/src/out/offdroid/md5sum_bin_host /s/chrome/src/out/offdroid/icudtl.dat
I 3.100s TimeoutThread-1-for-list_tests(02fb28b221082ede) [host]> /usr/local/google/home/primiano/tools/android-sdk/platform-tools/adb -s 02fb28b221082ede shell '( ( p=org.chromium.native_test;am instrument -w -e "$p".NativeTestInstrumentationTestRunner.ShardNanoTimeout 30000000000 -e "$p".NativeTestInstrumentationTestRunner.NativeTestActivity "$p".NativeUnitTestActivity -e "$p".NativeTestInstrumentationTestRunner.StdoutFile /sdcard/temp_file-1aa3800ad3622.gtest_out -e "$p".NativeTest.CommandLineFlags --gtest_list_tests "$p"/"$p".NativeTestInstrumentationTestRunner )>/data/local/tmp/temp_file-f430921fe1c96 );echo %$?'
I 5.753s TimeoutThread-1-for-list_tests(02fb28b221082ede) [host]> /usr/local/google/home/primiano/tools/android-sdk/platform-tools/adb -s 02fb28b221082ede pull /data/local/tmp/temp_file-f430921fe1c96 /tmp/tmp4ialQD/tmp_ReadFileWithPull
I 5.811s TimeoutThread-1-for-delete_temporary_file(02fb28b221082ede) [host]> /usr/local/google/home/primiano/tools/android-sdk/platform-tools/adb -s 02fb28b221082ede shell 'rm -f /data/local/tmp/temp_file-f430921fe1c96'
I 5.815s TimeoutThread-1-for-list_tests(02fb28b221082ede) [host]> /usr/local/google/home/primiano/tools/android-sdk/platform-tools/adb -s 02fb28b221082ede shell '( TZ=utc ls -a -l /sdcard/ );echo %$?'
E 5.883s list_tests(02fb28b221082ede) Shard failed: list_tests(02fb28b221082ede)
Traceback (most recent call last):
File "/s/chrome/src/build/android/pylib/local/device/local_device_environment.py", line 59, in wrapper
return f(dev, *args, **kwargs)
File "/s/chrome/src/build/android/pylib/local/device/local_device_gtest_run.py", line 364, in list_tests
None, dev, flags='--gtest_list_tests', timeout=30)
File "/s/chrome/src/build/android/pylib/local/device/local_device_gtest_run.py", line 183, in Run
stdout_file.name, device.StatPath(stdout_file.name).get('st_size', 0))
File "/s/chrome/src/third_party/catapult/devil/devil/android/device_utils.py", line 1839, in StatPath
'Cannot find file or directory: %r' % device_path, str(self))
CommandFailedError: (device: 02fb28b221082ede) Cannot find file or directory: '/sdcard/temp_file-1aa3800ad3622.gtest_out'
I 5.883s TimeoutThread-1-for-delete_temporary_file(02fb28b221082ede) [host]> /usr/local/google/home/primiano/tools/android-sdk/platform-tools/adb -s 02fb28b221082ede shell 'rm -f /sdcard/temp_file-1aa3800ad3622.gtest_out'
E 5.906s Main Error occurred.
Traceback (most recent call last):
File "/s/chrome/src/build/android/test_runner.py", line 926, in main
return RunTestsCommand(args)
File "/s/chrome/src/build/android/test_runner.py", line 684, in RunTestsCommand
return RunTestsInPlatformMode(args)
File "/s/chrome/src/build/android/test_runner.py", line 845, in RunTestsInPlatformMode
str(iteration_count))
File "/s/chrome/src/build/android/pylib/base/environment.py", line 33, in __exit__
self.TearDown()
File "/s/chrome/src/build/android/pylib/local/device/local_device_environment.py", line 234, in TearDown
self.parallel_devices.pMap(tear_down_device)
File "/s/chrome/src/build/android/pylib/local/device/local_device_environment.py", line 197, in parallel_devices
return parallelizer.SyncParallelizer(self.devices)
File "/s/chrome/src/build/android/pylib/local/device/local_device_environment.py", line 188, in devices
raise device_errors.NoDevicesError()
NoDevicesError: No devices attached.
,
Jun 13 2017
... that's odd, we should automatically grant permissions requested in the manifest at installation time. I don't see installation in the log above -- how'd you install the APK?
,
Jun 13 2017
> how'd you install the APK? I didn't, I just ran out/offdroid/bin/run_tracing_perftests
,
Jun 13 2017
The test runner thinks that tracing_perftests-debug.apk (with a matching md5sum) was already installed on the device. Can you reproduce if you uninstall org.chromium.native_test and then rerun?
,
Jun 13 2017
FWIW, I'm able to reproduce your error by manually installing tracing_perftests-debug.apk (w/ raw `adb install`, not build/android/adb_install_apk.py). You're absolutely right that the error message is terribly unhelpful, though.
,
Jun 13 2017
Ah, it's entirely possible that I did manually install that apk before then. Maybe we could do the pm grant regardless?
,
Jun 14 2017
Yep, we should both: - have a better error message, - pm grand regardless of whether the apk is already installed I can take a look at both.
,
Jun 29 2017
Quick update, I was able to reproduce this. Fixes coming soon :)
,
Jul 5 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/cfc1a42e00d26d42d65a3f916b52205e54181190 commit cfc1a42e00d26d42d65a3f916b52205e54181190 Author: catapult-deps-roller@chromium.org <catapult-deps-roller@chromium.org> Date: Wed Jul 05 19:51:49 2017 Roll src/third_party/catapult/ 34ef95cb0..a5b164508 (6 commits) https://chromium.googlesource.com/external/github.com/catapult-project/catapult.git/+log/34ef95cb09ce..a5b1645083bd $ git log 34ef95cb0..a5b164508 --date=short --no-merges --format='%ad %ae %s' 2017-07-05 kraynov Systrace: Fix update_systrace_trace_viewer.py script. 2017-07-05 nednguyen Run Telemetry on catapult CQ through wrapper script 2017-07-05 perezju [devil] Always set permissions on install 2017-07-05 sullivan Merge Alert model into Anomaly model. 2017-07-05 eakuefner [Tracing] Fix style issues in Python Ownership diagnostic 2017-07-05 sullivan Remove stray change marker. Created with: roll-dep src/third_party/catapult BUG= 732724 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, see: http://www.chromium.org/developers/tree-sheriffs/sheriff-details-chromium#TOC-Failures-due-to-DEPS-rolls CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel TBR=sullivan@chromium.org Change-Id: I7d53a5ce3d7f271f6fb335f2bf252d019019a36f Reviewed-on: https://chromium-review.googlesource.com/559910 Reviewed-by: <catapult-deps-roller@chromium.org> Commit-Queue: <catapult-deps-roller@chromium.org> Cr-Commit-Position: refs/heads/master@{#484334} [modify] https://crrev.com/cfc1a42e00d26d42d65a3f916b52205e54181190/DEPS
,
Jul 6 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/a249630e01a86a97dd4c8c322919d5b867d2e9e4 commit a249630e01a86a97dd4c8c322919d5b867d2e9e4 Author: catapult-deps-roller@chromium.org <catapult-deps-roller@chromium.org> Date: Thu Jul 06 01:14:18 2017 Roll src/third_party/catapult/ a5b164508..c9afbf3de (10 commits) https://chromium.googlesource.com/external/github.com/catapult-project/catapult.git/+log/a5b1645083bd..c9afbf3de780 $ git log a5b164508..c9afbf3de --date=short --no-merges --format='%ad %ae %s' 2017-07-05 benjhayden Refactor Generic, CollectedGeneric into GenericSet. 2017-07-05 jbudorick Revert of [devil] Always set permissions on install (patchset #1 id:1 of https://codereview.chromium.org/2963303002/ ) 2017-07-05 eakuefner [Telemetry] Delete discover shim 2017-07-05 sullivan Simplify perf dashboard initial comment on sheriff bugs. 2017-07-05 simonhatch Pinpoint - Add Polymer/paper-radio-button and Polymer/paper-radio-group to third_party 2017-07-05 eakuefner [Tracing] Add __eq__ implementation to Python Ownership 2017-07-05 sullivan Remove the concept of extra columns from alerts-table. 2017-07-05 simonhatch Dashboard - Remove retry logic entirely. 2017-07-05 benjhayden Remove tr.b.findFirstIndexInArray and tr.b.findFirstInArray. 2017-07-05 benjhayden Remove tr.b.comparePossiblyUndefinedValues. Created with: roll-dep src/third_party/catapult BUG= 732724 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, see: http://www.chromium.org/developers/tree-sheriffs/sheriff-details-chromium#TOC-Failures-due-to-DEPS-rolls CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel TBR=sullivan@chromium.org Change-Id: I41feddfdc59790e4d0ce95b6615ba125ad119d89 Reviewed-on: https://chromium-review.googlesource.com/560778 Reviewed-by: <catapult-deps-roller@chromium.org> Commit-Queue: <catapult-deps-roller@chromium.org> Cr-Commit-Position: refs/heads/master@{#484434} [modify] https://crrev.com/a249630e01a86a97dd4c8c322919d5b867d2e9e4/DEPS
,
Jul 12 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/18f863a17129ac080b63b6efd370ffc4f85e89b6 commit 18f863a17129ac080b63b6efd370ffc4f85e89b6 Author: Juan A. Navarro Perez <perezju@chromium.org> Date: Wed Jul 12 10:43:35 2017 [build/android] Improve error reporting when all devices get blacklisted A plain "NoDevicesError" with no further explanation was confusing to developrts when there were devices but all failed with some errors. Bug: 732724 Change-Id: Ib4d2bff47ca85da3212e28394f6d41742df7cf53 Reviewed-on: https://chromium-review.googlesource.com/558072 Reviewed-by: Primiano Tucci <primiano@chromium.org> Reviewed-by: John Budorick <jbudorick@chromium.org> Commit-Queue: Juan Antonio Navarro Pérez <perezju@chromium.org> Cr-Commit-Position: refs/heads/master@{#485918} [modify] https://crrev.com/18f863a17129ac080b63b6efd370ffc4f85e89b6/build/android/pylib/local/device/local_device_environment.py
,
Jul 18 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/4418a7afa2876cd528081d01ac6fd85c9f2231f1 commit 4418a7afa2876cd528081d01ac6fd85c9f2231f1 Author: catapult-deps-roller@chromium.org <catapult-deps-roller@chromium.org> Date: Tue Jul 18 11:42:02 2017 Roll src/third_party/catapult/ 44b022b2a..6fc5e4196 (1 commit) https://chromium.googlesource.com/external/github.com/catapult-project/catapult.git/+log/44b022b2a095..6fc5e4196940 $ git log 44b022b2a..6fc5e4196 --date=short --no-merges --format='%ad %ae %s' 2017-07-18 perezju [devil] Set permissions on install and gracefully handle errors Created with: roll-dep src/third_party/catapult BUG= 732724 ,739531 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, see: http://www.chromium.org/developers/tree-sheriffs/sheriff-details-chromium#TOC-Failures-due-to-DEPS-rolls CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel TBR=sullivan@chromium.org Change-Id: I2e1bd2fc2ce6d34a3364e89fee82e220c4db508d Reviewed-on: https://chromium-review.googlesource.com/576073 Reviewed-by: <catapult-deps-roller@chromium.org> Commit-Queue: <catapult-deps-roller@chromium.org> Cr-Commit-Position: refs/heads/master@{#487444} [modify] https://crrev.com/4418a7afa2876cd528081d01ac6fd85c9f2231f1/DEPS
,
Jul 18 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by primiano@chromium.org
, Jun 13 2017