diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-10-21 23:37:12 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-10-24 11:24:03 +0100 |
| commit | 7671fdcaf6a788d80dbe002573f8b7d7f39d13c8 (patch) | |
| tree | 2d41bf94a2fd6a17d8e4220c4a8086807f6f91b1 | |
| parent | 9c80b40ee5a98cf6e7b1cda6b2951b178ac28524 (diff) | |
| download | poky-7671fdcaf6a788d80dbe002573f8b7d7f39d13c8.tar.gz | |
bitbake: toaster/tests/functional/utils: Drop unused code from wait_until_build_cancelled
The code modifying the build object requires direct database access
which is potentially problematic. It was being run on a database which
was being reset after changes anyway so the code effectively did nothing.
Remove it as it is unneeded.
(Bitbake rev: 2e3fa624eb3972aef91d877337479eeb0f3dd365)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | bitbake/lib/toaster/tests/functional/utils.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/bitbake/lib/toaster/tests/functional/utils.py b/bitbake/lib/toaster/tests/functional/utils.py index 7269fa1805..8e81c29984 100644 --- a/bitbake/lib/toaster/tests/functional/utils.py +++ b/bitbake/lib/toaster/tests/functional/utils.py | |||
| @@ -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,11 +63,7 @@ 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: | 69 | except NoSuchElementException: |
