comparison unix.py @ 100:995502cdafc6 2.00.0

Fixed the generic implementation of call to use maxwalltime
author Oleg Oshmyan <chortos@inbox.lv>
date Thu, 03 Mar 2011 21:09:41 +0000
parents b7fb64ce03d9
children 218b8c28549c
comparison
equal deleted inserted replaced
99:9b41934b2e95 100:995502cdafc6
59 try: 59 try:
60 case.process = Popen(*args, **kwargs) 60 case.process = Popen(*args, **kwargs)
61 except OSError: 61 except OSError:
62 raise testcases.CannotStartTestee(sys.exc_info()[1]) 62 raise testcases.CannotStartTestee(sys.exc_info()[1])
63 case.time_started = clock() 63 case.time_started = clock()
64 if not case.maxtime: 64 if not case.maxwalltime:
65 while True: 65 while True:
66 exitcode, now = case.process.poll(), clock() 66 exitcode, now = case.process.poll(), clock()
67 if exitcode is not None: 67 if exitcode is not None:
68 case.time_stopped = now 68 case.time_stopped = now
69 break 69 break
70 else: 70 else:
71 time.sleep(.001) 71 time.sleep(.001)
72 else: 72 else:
73 time_end = case.time_started + case.maxtime 73 time_end = case.time_started + case.maxwalltime
74 while True: 74 while True:
75 exitcode, now = case.process.poll(), clock() 75 exitcode, now = case.process.poll(), clock()
76 if exitcode is not None: 76 if exitcode is not None:
77 case.time_stopped = now 77 case.time_stopped = now
78 break 78 break