Commit 77c3cd8b authored by Julien Muchembled's avatar Julien Muchembled Committed by Sebastien Robin

TaskDistributionTool: fix bots restarting test suites without any reason

parent 4798c2e6
...@@ -124,16 +124,12 @@ class TaskDistributionTool(BaseTool): ...@@ -124,16 +124,12 @@ class TaskDistributionTool(BaseTool):
int_index, reference = revision int_index, reference = revision
result_list = portal.test_result_module.searchFolder( result_list = portal.test_result_module.searchFolder(
portal_type="Test Result", portal_type="Test Result",
simulation_state="started",
title="=%s" % test_title, title="=%s" % test_title,
sort_on=(("creation_date","descending"),), sort_on=(("creation_date","descending"),),
limit=1) limit=1)
if result_list: if result_list:
test_result = result_list[0].getObject() test_result = result_list[0].getObject()
if test_result is None or test_result.getSimulationState() in \ if test_result is not None:
('cancelled', 'failed'):
pass
else:
last_state = test_result.getSimulationState() last_state = test_result.getSimulationState()
last_revision = str(test_result.getIntIndex()) last_revision = str(test_result.getIntIndex())
if last_state == 'started': if last_state == 'started':
...@@ -148,7 +144,7 @@ class TaskDistributionTool(BaseTool): ...@@ -148,7 +144,7 @@ class TaskDistributionTool(BaseTool):
test_result.serialize() # prevent duplicate test result lines test_result.serialize() # prevent duplicate test result lines
createTestResultLineList(test_result, test_name_list) createTestResultLineList(test_result, test_name_list)
return test_result.getRelativeUrl(), last_revision return test_result.getRelativeUrl(), last_revision
if last_state == 'stopped': if last_state in ('stopped', 'failed'):
if reference_list_string is not None: if reference_list_string is not None:
if reference_list_string == test_result.getReference(): if reference_list_string == test_result.getReference():
return return
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment