google / mobly

E2E test framework for tests with complex environment requirements.
https://github.com/google/mobly
Apache License 2.0
647 stars 179 forks source link

A pull request to solve the "AdbTimeoutError: Timed out executing command "adb -s d6d5974 shell getprop sys.boot_completed" after 5s. " bug during waiting the device for fully boot up as adb. #596

Closed hanx-github closed 5 years ago

hanx-github commented 5 years ago

This change is Reviewable

hanx-github commented 5 years ago

tests/mobly/controllers/android_device_test.py, line 908 at r1 (raw file):

Previously, winterfroststrom wrote…
> ``` > test_AndroidDevice_wait_for_completion > ``` Doesn't this test have sleep wait in real time? Could you mock that? Additionally, could you add tests for when the device never boots (overriding the timeout as well)?

I have added another test case test_AndroidDevice_wait_for_completion_completed.

Here are the two successful runs: (mobly_dev_env) ➜ mobly git:(master) python tests/mobly/controllers/android_device_test.py AndroidDeviceTest.test_AndroidDevice_wait_for_completion_never_boot .

Ran 1 test in 0.002s

OK (mobly_dev_env) ➜ mobly git:(master) python tests/mobly/controllers/android_device_test.py AndroidDeviceTest.test_AndroidDevice_wait_for_completion_completed .

Ran 1 test in 0.002s

OK (mobly_dev_env) ➜ mobly git:(master)

hanx-github commented 5 years ago

tests/mobly/controllers/android_device_test.py, line 908 at r1 (raw file):

Previously, hanx-github wrote…
I have added another test case test_AndroidDevice_wait_for_completion_completed. Here are the two successful runs: (mobly_dev_env) ➜ mobly git:(master) python tests/mobly/controllers/android_device_test.py AndroidDeviceTest.test_AndroidDevice_wait_for_completion_never_boot . ---------------------------------------------------------------------- Ran 1 test in 0.002s OK (mobly_dev_env) ➜ mobly git:(master) python tests/mobly/controllers/android_device_test.py AndroidDeviceTest.test_AndroidDevice_wait_for_completion_completed . ---------------------------------------------------------------------- Ran 1 test in 0.002s OK (mobly_dev_env) ➜ mobly git:(master)

Done.