lib/parallel_tests/cli.rb in parallel_tests-1.3.7 vs lib/parallel_tests/cli.rb in parallel_tests-1.3.8
- old
+ new
@@ -62,14 +62,14 @@
@runner.run_tests(group, process_number, num_processes, options)
end
end
def report_output(result, lock)
- lock.flock File::LOCK_EX
- $stdout.puts result[:stdout]
- $stdout.flush
- ensure
- lock.flock File::LOCK_UN
+ File.open(lock.path) do |open_lock|
+ open_lock.flock File::LOCK_EX
+ $stdout.puts result[:stdout]
+ $stdout.flush
+ end
end
def report_results(test_results)
results = @runner.find_results(test_results.map { |result| result[:stdout] }*"")
puts ""