[Core][Bug] Fix 'task start --abort-on-sla-failure'

In current implementation --abort-on-sla-failure affects
only currently running workload and allows to run next
subtasks/workloads after sla failure.

* Change status of task to SOFT_ABORTING after sla failure.
  This allows to consume results from pending iterations
  and abort task before running next subtask/workload.

Change-Id: I1498b62fd6929101ff4d45ca78e185f124ab7b89
This commit is contained in:
Anton Studenov 2016-12-01 14:58:11 +03:00
parent 33901857fe
commit ecbeed3027

View File

@ -563,6 +563,8 @@ class TaskTestCase(unittest.TestCase):
{"task_file": config.filename,
"deployment_id": deployment_id})
results = json.loads(rally("task results"))
self.assertEqual(1, len(results),
"Second subtask should not be started")
iterations_completed = len(results[0]["result"])
self.assertLess(iterations_completed, times)
@ -582,6 +584,16 @@ class TaskTestCase(unittest.TestCase):
"sla": {
"max_seconds_per_iteration": 0.01
}
},
{
"args": {
"sleep": 0.1
},
"runner": {
"type": "constant",
"times": 1,
"concurrency": 1
},
}
]
}
@ -602,6 +614,16 @@ class TaskTestCase(unittest.TestCase):
"sla": {
"max_seconds_per_iteration": 0.01
}
},
{
"args": {
"sleep": 0.1
},
"runner": {
"type": "constant",
"times": 1,
"concurrency": 1
},
}
]
}
@ -623,6 +645,16 @@ class TaskTestCase(unittest.TestCase):
"sla": {
"max_seconds_per_iteration": 0.01
}
},
{
"args": {
"sleep": 0.1
},
"runner": {
"type": "constant",
"times": 1,
"concurrency": 1
},
}
]
}
@ -644,6 +676,16 @@ class TaskTestCase(unittest.TestCase):
"sla": {
"failure_rate": {"max": 0.0}
}
},
{
"args": {
"sleep": 0.1
},
"runner": {
"type": "constant",
"times": 1,
"concurrency": 1
},
}
]
}
@ -664,6 +706,16 @@ class TaskTestCase(unittest.TestCase):
"sla": {
"failure_rate": {"max": 0.0}
}
},
{
"args": {
"sleep": 0.1
},
"runner": {
"type": "constant",
"times": 1,
"concurrency": 1
},
}
]
}
@ -685,6 +737,16 @@ class TaskTestCase(unittest.TestCase):
"sla": {
"failure_rate": {"max": 0.0}
}
},
{
"args": {
"sleep": 0.1
},
"runner": {
"type": "constant",
"times": 1,
"concurrency": 1
},
}
]
}