# HG changeset patch # User Oleg Oshmyan # Date 1302274614 -10800 # Node ID 4e6f231f055fd100cd3630d1b84b15447ac002e5 # Parent 796eb7667fb0498c34a1844f286a1ae2b1b599cf Fixed race condition resulting in calling back twice from TestCase.test diff -r 796eb7667fb0 -r 4e6f231f055f testcases.py --- a/testcases.py Fri Apr 01 23:58:46 2011 +0300 +++ b/testcases.py Fri Apr 08 17:56:54 2011 +0300 @@ -317,8 +317,8 @@ call(case.problem.config.path, case=case, stdin=infile, stdout=outfile, stderr=devnull, universal_newlines=True, bufsize=-1) if config.globalconf.force_zero_exitcode and case.process.returncode or case.process.returncode < 0: raise NonZeroExitCode(case.process.returncode) + case.has_called_back = True callback() - case.has_called_back = True outfile.seek(0) return case.validate(outfile) else: @@ -326,8 +326,8 @@ call(case.problem.config.path, case=case, stdin=devnull, stdout=devnull, stderr=STDOUT) if config.globalconf.force_zero_exitcode and case.process.returncode or case.process.returncode < 0: raise NonZeroExitCode(case.process.returncode) + case.has_called_back = True callback() - case.has_called_back = True with open(case.problem.config.outname, 'rU') as output: return case.validate(output)