diff options
Diffstat (limited to 'bitbake/lib/toaster/tests/functional/utils.py')
-rw-r--r-- | bitbake/lib/toaster/tests/functional/utils.py | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/bitbake/lib/toaster/tests/functional/utils.py b/bitbake/lib/toaster/tests/functional/utils.py index 7269fa1805..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 |
@@ -36,7 +36,7 @@ def wait_until_build(test_instance, state): | |||
36 | if 'failed' in str(build_state).lower(): | 36 | if 'failed' in str(build_state).lower(): |
37 | break | 37 | break |
38 | except NoSuchElementException: | 38 | except NoSuchElementException: |
39 | continue | 39 | pass |
40 | except TimeoutException: | 40 | except TimeoutException: |
41 | break | 41 | break |
42 | start_time += 1 | 42 | start_time += 1 |
@@ -48,7 +48,6 @@ def wait_until_build_cancelled(test_instance): | |||
48 | """ | 48 | """ |
49 | timeout = 30 | 49 | timeout = 30 |
50 | start_time = 0 | 50 | start_time = 0 |
51 | build = None | ||
52 | while True: | 51 | while True: |
53 | try: | 52 | try: |
54 | if start_time > timeout: | 53 | if start_time > timeout: |
@@ -64,19 +63,17 @@ def wait_until_build_cancelled(test_instance): | |||
64 | if 'failed' in str(build_state).lower(): | 63 | if 'failed' in str(build_state).lower(): |
65 | break | 64 | break |
66 | if 'cancelling' in str(build_state).lower(): | 65 | if 'cancelling' in str(build_state).lower(): |
67 | # Change build state to cancelled | 66 | pass |
68 | if not build: # get build object only once | ||
69 | build = Build.objects.last() | ||
70 | build.outcome = Build.CANCELLED | ||
71 | build.save() | ||
72 | if 'cancelled' in str(build_state).lower(): | 67 | if 'cancelled' in str(build_state).lower(): |
73 | break | 68 | break |
74 | except NoSuchElementException: | ||
75 | continue | ||
76 | except StaleElementReferenceException: | ||
77 | continue | ||
78 | except TimeoutException: | 69 | except TimeoutException: |
79 | break | 70 | break |
71 | except NoSuchElementException: | ||
72 | pass | ||
73 | except StaleElementReferenceException: | ||
74 | pass | ||
75 | except WebDriverException: | ||
76 | pass | ||
80 | start_time += 1 | 77 | start_time += 1 |
81 | sleep(1) # take a breath and try again | 78 | sleep(1) # take a breath and try again |
82 | 79 | ||