From a1a34d675fd05c4531d45e3ea229867262cddeba Mon Sep 17 00:00:00 2001 From: "andrew@webrtc.org" Date: Wed, 23 May 2012 00:45:00 +0000 Subject: [PATCH] Avoid flakiness by skipping more output verification. - Add a SCOPED_TRACE in case it flakes out again. - The test doesn't need to be very long, so shorten it to save the bots some time. TBR=henrike@webrtc.org BUG= TEST=voe_auto_test Review URL: https://webrtc-codereview.appspot.com/588006 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2273 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../main/test/auto_test/standard/mixing_test.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/voice_engine/main/test/auto_test/standard/mixing_test.cc b/src/voice_engine/main/test/auto_test/standard/mixing_test.cc index 5e6ca4a2f5..68ab73292f 100644 --- a/src/voice_engine/main/test/auto_test/standard/mixing_test.cc +++ b/src/voice_engine/main/test/auto_test/standard/mixing_test.cc @@ -21,7 +21,8 @@ namespace { const int16_t kLimiterHeadroom = 29204; // == -1 dbFS const int16_t kInt16Max = 0x7fff; const int kSampleRateHz = 16000; -const int kTestDurationMs = 4000; +const int kTestDurationMs = 3000; +const int kSkipOutputMs = 500; } // namespace @@ -102,18 +103,21 @@ class MixingTest : public AfterInitializationFixture { FILE* output_file = fopen(output_filename_.c_str(), "rb"); ASSERT_TRUE(output_file != NULL); int16_t output_value = 0; - // Skip the first 100 ms to avoid initialization and ramping-in effects. - EXPECT_EQ(0, fseek(output_file, sizeof(output_value) * kSampleRateHz / 10, - SEEK_SET)); + // Skip the first segment to avoid initialization and ramping-in effects. + EXPECT_EQ(0, fseek(output_file, sizeof(output_value) * + kSampleRateHz / 1000 * kSkipOutputMs, SEEK_SET)); int samples_read = 0; while (fread(&output_value, sizeof(output_value), 1, output_file) == 1) { samples_read++; + std::ostringstream trace_stream; + trace_stream << samples_read << " samples read"; + SCOPED_TRACE(trace_stream.str()); EXPECT_LE(output_value, max_output_value); EXPECT_GE(output_value, min_output_value); } // Ensure the recording length is close to the duration of the test. ASSERT_GE((samples_read * 1000.0f) / kSampleRateHz, - 0.9f * kTestDurationMs); + kTestDurationMs - kSkipOutputMs); // Ensure we read the entire file. ASSERT_NE(0, feof(output_file)); ASSERT_EQ(0, fclose(output_file));