From 3cb5e5bea261af3986ee15e99642ee0455623f39 Mon Sep 17 00:00:00 2001 From: Yves Gerey Date: Thu, 21 Mar 2019 11:22:42 +0100 Subject: [PATCH] Fix VideoFileWriterTest flakiness by using unique file path. Both reference and tested videos were created via a file whose path was fixed. So, when tests were launched in parallel, race conditions ensued. This CL creates an unique temporary filename for each video. Bug: webrtc:10156 Change-Id: Ie3abf85abdfa95735cb86880bbd6a59393e609c1 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127883 Reviewed-by: Mirko Bonadei Reviewed-by: Niels Moller Reviewed-by: Paulina Hensman Commit-Queue: Yves Gerey Cr-Commit-Position: refs/heads/master@{#27219} --- rtc_tools/video_file_writer.cc | 29 +++++++++- rtc_tools/video_file_writer.h | 10 ++++ rtc_tools/video_file_writer_unittest.cc | 74 ++++++++++++++++--------- 3 files changed, 86 insertions(+), 27 deletions(-) diff --git a/rtc_tools/video_file_writer.cc b/rtc_tools/video_file_writer.cc index e7a649fe8b..dc7a69953e 100644 --- a/rtc_tools/video_file_writer.cc +++ b/rtc_tools/video_file_writer.cc @@ -20,17 +20,19 @@ namespace webrtc { namespace test { +namespace { void WriteVideoToFile(const rtc::scoped_refptr