[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:
parent
33901857fe
commit
ecbeed3027
@ -563,6 +563,8 @@ class TaskTestCase(unittest.TestCase):
|
|||||||
{"task_file": config.filename,
|
{"task_file": config.filename,
|
||||||
"deployment_id": deployment_id})
|
"deployment_id": deployment_id})
|
||||||
results = json.loads(rally("task results"))
|
results = json.loads(rally("task results"))
|
||||||
|
self.assertEqual(1, len(results),
|
||||||
|
"Second subtask should not be started")
|
||||||
iterations_completed = len(results[0]["result"])
|
iterations_completed = len(results[0]["result"])
|
||||||
self.assertLess(iterations_completed, times)
|
self.assertLess(iterations_completed, times)
|
||||||
|
|
||||||
@ -582,6 +584,16 @@ class TaskTestCase(unittest.TestCase):
|
|||||||
"sla": {
|
"sla": {
|
||||||
"max_seconds_per_iteration": 0.01
|
"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": {
|
"sla": {
|
||||||
"max_seconds_per_iteration": 0.01
|
"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": {
|
"sla": {
|
||||||
"max_seconds_per_iteration": 0.01
|
"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": {
|
"sla": {
|
||||||
"failure_rate": {"max": 0.0}
|
"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": {
|
"sla": {
|
||||||
"failure_rate": {"max": 0.0}
|
"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": {
|
"sla": {
|
||||||
"failure_rate": {"max": 0.0}
|
"failure_rate": {"max": 0.0}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"args": {
|
||||||
|
"sleep": 0.1
|
||||||
|
},
|
||||||
|
"runner": {
|
||||||
|
"type": "constant",
|
||||||
|
"times": 1,
|
||||||
|
"concurrency": 1
|
||||||
|
},
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user