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