comparison unix.py @ 119:0b265fe9c81f

Wall-clock time limit is now enforced on the output wall-clock time
author Oleg Oshmyan <chortos@inbox.lv>
date Fri, 15 Apr 2011 03:06:29 +0300
parents 16fe21d6582e
children 90c002c960cb
comparison
equal deleted inserted replaced
118:16fe21d6582e 119:0b265fe9c81f
205 finally: 205 finally:
206 case.time_started, cpustart = pickle.loads(os.read(read, 512)) 206 case.time_started, cpustart = pickle.loads(os.read(read, 512))
207 os.close(read) 207 os.close(read)
208 del bury_child.case 208 del bury_child.case
209 new_rusage = getrusage(RUSAGE_CHILDREN) 209 new_rusage = getrusage(RUSAGE_CHILDREN)
210 if (case.maxwalltime and
211 case.time_stopped - case.time_started > case.maxwalltime):
212 raise testcases.WallTimeLimitExceeded
210 if new_rusage and (case.maxcputime or not case.maxwalltime): 213 if new_rusage and (case.maxcputime or not case.maxwalltime):
211 case.time_started = cpustart 214 case.time_started = cpustart
212 case.time_stopped = new_rusage.ru_utime + new_rusage.ru_stime 215 case.time_stopped = new_rusage.ru_utime + new_rusage.ru_stime
213 case.time_limit_string = case.cpu_time_limit_string 216 case.time_limit_string = case.cpu_time_limit_string
214 if case.maxcputime and new_rusage: 217 if case.maxcputime and new_rusage: