@@ -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:
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> --- lib/toaster/tests/functional/utils.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)