Commit eafb53a1 authored by Łukasz Nowak's avatar Łukasz Nowak

Expose and simplify configuration

parent 2343b622
......@@ -6,6 +6,10 @@ from time import gmtime, strftime, time, sleep
from erp5.util import taskdistribution
SLEEP_TIME = 10
TRY_AMOUNT = 3600
class DummyTestResult:
class DummyTestResultLine:
......@@ -78,14 +82,12 @@ def main():
status_dict = {'command': 'file not found'}
# find test result, wait 10h
sleep_time = 10
try_amount = (3600 * 10) / sleep_time
try_num = 1
start = time()
result_found = False
while 1:
finished = False
try_info = 'Try %s/%s.' % (try_num, try_amount)
try_info = 'Try %s/%s.' % (try_num, TRY_AMOUNT)
test_result_glob = os.path.join(
args.partition_path,
'..',
......@@ -153,14 +155,14 @@ def main():
finished = False
if finished:
break
if try_num >= try_amount:
if try_num >= TRY_AMOUNT:
msg = try_info + ' Time exceeded, success not found.'
print(msg)
status_dict.setdefault('stdout', '')
status_dict['stdout'] = '\n'.join([status_dict['stdout'], msg])
break
try_num += 1
sleep(10)
sleep(SLEEP_TIME)
if not result_found:
status_dict['stdout'] = try_info + ' Test timed out and no result found.'
status_dict.update(
......
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