google / mobly

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

Add a retry mechanism for the ADB command "root" #690

Closed chuanhsiao closed 3 years ago

chuanhsiao commented 3 years ago

Sometimes Error "adb: unable to connect for root: closed" occurs when calling AndroidDevice.reboot(), this mechanism attempts to avoid this error causes a test to be stopped.


This change is Reviewable

chuanhsiao commented 3 years ago

Need to add unit tests for the added method:

  1. regular case, no retry
  2. retry being triggered and retry is successful
  3. all three retries failed and an exception is thrown

Added.

chuanhsiao commented 3 years ago

Reviewable status: 0 of 2 files reviewed, 7 unresolved discussions (waiting on @chuanhsiao and @xpconanfan)

_tests/mobly/controllers/android_device_lib/adb_test.py, line 733 at r3 (raw file):_

Previously, chuanhsiao wrote… sg, now needs another rebase :)

rebase completed