Bug 1195558 - when a recipe has <reservesys/> and at least one task has completed, cancelling it reserves the system instead of cancelling
Summary: when a recipe has <reservesys/> and at least one task has completed, cancelli...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: scheduler
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 21.0
Assignee: Dan Callaghan
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-24 04:58 UTC by Dan Callaghan
Modified: 2018-02-06 00:41 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-08-26 06:17:29 UTC
Embargoed:


Attachments (Terms of Use)

Description Dan Callaghan 2015-02-24 04:58:08 UTC
Version-Release number of selected component (if applicable):
19.2

Steps to Reproduce:
1. Submit a recipe with 2 or more tasks, and <reservesys/>. For easy reproduction, use:
<task name="/distribution/install"/>
<task name="/distribution/reservesys"/>
<reservesys/>
2. Wait until the recipe is running, with the first task completed and the second task running.
3. Cancel the job.

Actual results:
Recipe goes to "Reserved" status and the system is held for 24 more hours.

Expected results:
Job is cancelled.

Comment 1 Dan Callaghan 2015-02-24 05:49:04 UTC
Failing test case:

index 9a41bf7..c7bcb8b 100644
--- a/IntegrationTests/src/bkr/inttest/server/test_update_status.py
+++ b/IntegrationTests/src/bkr/inttest/server/test_update_status.py
@@ -206,12 +206,14 @@ def test_recipe_running_then_cancelled(self):
         """
         with session.begin():
             recipe = data_setup.create_recipe(
-                task_list=[Task.by_name(u'/distribution/install')],
+                task_list=[Task.by_name(u'/distribution/install')] * 2,
                 reservesys=True)
             job = data_setup.create_job_for_recipes([recipe])
             job_id = job.id
             data_setup.mark_recipe_running(recipe)
-            job._mark_dirty()
+            data_setup.mark_recipe_installation_finished(recipe)
+            job.recipesets[0].recipes[0].tasks[0].stop()
+            job.recipesets[0].recipes[0].tasks[1].start()
         beakerd.update_dirty_jobs()
         with session.begin():
             job = Job.by_id(job_id)

Bug 714937 should solve this bug for free (the problem happens because Completed is "lower severity" than Cancelled and hence the min_status in update_status is Completed instead of Cancelled in this case).

Comment 2 Dan Callaghan 2015-04-24 04:06:27 UTC
Test case only (this is fixed by bug 714937):

http://gerrit.beaker-project.org/4190

Comment 5 Dan Callaghan 2015-08-26 06:17:29 UTC
Beaker 21.0 has been released.


Note You need to log in before you can comment on or make changes to this bug.