mirror of https://github.com/tc39/test262.git
Runner: Re-use lock to share access to stdout
When executing multiple tests in parallel, each "child" thread would write to the process's standard output buffer immediately upon test completion. Because thread execution order and instruction interleaving is non-deterministic, this made it possible for characters to be emitted out-of-order. When extended to support multiple concurrent threads, the runner was outfitted with a "log lock" dedicated to sharing access to the output file (when applicable). Re-use this lock when writing to standard out, ensuring proper ordering of test result messages.
This commit is contained in:
parent
217812891c
commit
b791cc4fbe
|
@ -606,10 +606,11 @@ class TestSuite(object):
|
|||
if logname:
|
||||
self.WriteLog(result)
|
||||
finally:
|
||||
progress.HasRun(result)
|
||||
|
||||
if workers_count > 1:
|
||||
log_lock.release()
|
||||
|
||||
progress.HasRun(result)
|
||||
if workers_count == 1:
|
||||
exec_case()
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue