diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-10-22 14:04:57 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-10-24 11:24:03 +0100 |
commit | 6ee37562d4e1a601bac60b02b798fc12fec1a745 (patch) | |
tree | acfe245a365f14b31d15113a106250cede1ccaea /bitbake/lib/toaster/tests/functional/utils.py | |
parent | 56a8e5283e4e53ee108f91bf92843a30740c3a6e (diff) | |
download | poky-6ee37562d4e1a601bac60b02b798fc12fec1a745.tar.gz |
bitbake: toaster/tests/functional/utils: Handle WebDriverException
Fix the exception handling in the cancel builds function.
This involved adding WebDriverException which sometimes occurs but
also correcting the other exception handlers to continue to increment
the timeout to avoid test hangs.
(Bitbake rev: e111a2bd4f7a8a4dc2c63e94e91ac6cacca95af8)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/tests/functional/utils.py')
-rw-r--r-- | bitbake/lib/toaster/tests/functional/utils.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/bitbake/lib/toaster/tests/functional/utils.py b/bitbake/lib/toaster/tests/functional/utils.py index d8394708e8..72345aef9f 100644 --- a/bitbake/lib/toaster/tests/functional/utils.py +++ b/bitbake/lib/toaster/tests/functional/utils.py | |||
@@ -8,7 +8,7 @@ | |||
8 | 8 | ||
9 | 9 | ||
10 | from time import sleep | 10 | from time import sleep |
11 | from selenium.common.exceptions import NoSuchElementException, StaleElementReferenceException, TimeoutException | 11 | from selenium.common.exceptions import NoSuchElementException, StaleElementReferenceException, TimeoutException, WebDriverException |
12 | from selenium.webdriver.common.by import By | 12 | from selenium.webdriver.common.by import By |
13 | 13 | ||
14 | from orm.models import Build | 14 | from orm.models import Build |
@@ -66,12 +66,14 @@ def wait_until_build_cancelled(test_instance): | |||
66 | pass | 66 | pass |
67 | if 'cancelled' in str(build_state).lower(): | 67 | if 'cancelled' in str(build_state).lower(): |
68 | break | 68 | break |
69 | except NoSuchElementException: | ||
70 | continue | ||
71 | except StaleElementReferenceException: | ||
72 | continue | ||
73 | except TimeoutException: | 69 | except TimeoutException: |
74 | break | 70 | break |
71 | except NoSuchElementException: | ||
72 | pass | ||
73 | except StaleElementReferenceException: | ||
74 | pass | ||
75 | except WebDriverException: | ||
76 | pass | ||
75 | start_time += 1 | 77 | start_time += 1 |
76 | sleep(1) # take a breath and try again | 78 | sleep(1) # take a breath and try again |
77 | 79 | ||