fix(appium-tests): give the USB permission dialog a real timeout after replug
Re-enumeration and the system permission dialog can lag several seconds while the guest is under heavy write I/O; the previous 1s wait made the unplug tests flaky.
This commit is contained in:
2 files changed
+6
-4
No files matched your search
@@ -53,8 +53,8 @@ def grant_usb_permission(driver: Remote):
|
||||
pass
|
||||
|
||||
|
||||
def accept_usb_permission(driver: Remote):
|
||||
ok_btn = wait_for_element(driver, '//*[@text="OK"]', timeout=1)
|
||||
def accept_usb_permission(driver: Remote, timeout: float = 1):
|
||||
ok_btn = wait_for_element(driver, '//*[@text="OK"]', timeout=timeout)
|
||||
ok_btn.click()
|
||||
|
||||
|
||||
|
||||
@@ -52,7 +52,9 @@ def unplug_and_reconnect_usb(
|
||||
sleep(3)
|
||||
|
||||
mark("Accepting permission...")
|
||||
app.accept_usb_permission(driver)
|
||||
# Generous timeout: re-enumeration and the permission dialog can lag several seconds
|
||||
# while the guest is under heavy write I/O.
|
||||
app.accept_usb_permission(driver, timeout=15)
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
@@ -240,7 +242,7 @@ def test_unplug_resume_from_notification(
|
||||
# A patch should be submitted to libaums to handle this.
|
||||
sleep(3)
|
||||
|
||||
app.accept_usb_permission(driver)
|
||||
app.accept_usb_permission(driver, timeout=15)
|
||||
|
||||
skip_btn = app.get_skip_verify_button(driver)
|
||||
skip_btn.click()
|
||||
|
||||
Reference in new issue
Block a user