Commit 25a70167 authored by Sebastien Robin's avatar Sebastien Robin

erp5_test_result: take care of timeouts when we invalidate test nodes

parent b01ef532
......@@ -6,16 +6,25 @@ now = DateTime()
list_node = context.portal_catalog(
portal_type="Test Node",
)
old_date = now-1.0/24*11
default_old_date = now-1.0/24*11
for test_node in list_node:
old_date = default_old_date
test_node = test_node.getObject()
ping_date = test_node.getPingDate()
validation_state = test_node.getValidationState()
distributor = test_node.getSpecialiseValue()
if distributor is not None:
timeout_method = getattr(distributor, 'getProcessTimeout', None)
if timeout_method is not None:
timeout = timeout_method()
if timeout:
old_date = now - float(timeout)/(24*3600)
if validation_state == 'validated':
if ping_date is not None:
if ping_date <= old_date:
test_node.invalidate()
elif validation_state == 'invalidated':
__traceback_info__ = test_node
if test_node.getSpecialise():
test_node.getSpecialiseValue().cleanupInvalidatedTestNode(test_node)
......
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