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>
This commit is contained in:
Richard Purdie
2024-10-21 23:37:12 +01:00
parent 9c80b40ee5
commit 7671fdcaf6

View File

@@ -48,7 +48,6 @@ def wait_until_build_cancelled(test_instance):
"""
timeout = 30
start_time = 0
build = None
while True:
try:
if start_time > timeout:
@@ -64,11 +63,7 @@ def wait_until_build_cancelled(test_instance):
if 'failed' in str(build_state).lower():
break
if 'cancelling' in str(build_state).lower():
# Change build state to cancelled
if not build: # get build object only once
build = Build.objects.last()
build.outcome = Build.CANCELLED
build.save()
pass
if 'cancelled' in str(build_state).lower():
break
except NoSuchElementException: