From 0500b528a6f6daba89d617bf5b73b2353bdfbe71 Mon Sep 17 00:00:00 2001 From: Ilya Nikolaevskiy Date: Tue, 22 Jan 2019 11:12:51 +0100 Subject: [PATCH] Reduce webrtc_perf_tests duration on buildbots MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On buildbots WebRTC-QuickPerfTest field trial is set. Ensure all FullStackTests don't overwrite this trial and use shorter timeout in it's presence. Also, reduce timeouts in the longest CallPerfTests. Bug: None Change-Id: If70890f4fe47942b5ea44bfeb26cdc4cee9fa885 Reviewed-on: https://webrtc-review.googlesource.com/c/118923 Reviewed-by: Erik Språng Reviewed-by: Niels Moller Commit-Queue: Ilya Nikolaevskiy Cr-Commit-Position: refs/heads/master@{#26356} --- call/call_perf_tests.cc | 9 +++++++-- video/full_stack_tests.cc | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/call/call_perf_tests.cc b/call/call_perf_tests.cc index c584bffa8a..3ffcb6b8f4 100644 --- a/call/call_perf_tests.cc +++ b/call/call_perf_tests.cc @@ -848,6 +848,7 @@ void CallPerfTest::TestMinAudioVideoBitrate( static constexpr int kBitrateStabilizationMs = 10000; static constexpr int kBitrateMeasurements = 10; static constexpr int kBitrateMeasurementMs = 1000; + static constexpr int kShortDelayMs = 10; static constexpr int kMinGoodRttMs = 400; class MinVideoAndAudioBitrateTester : public test::EndToEndTest { @@ -904,6 +905,10 @@ void CallPerfTest::TestMinAudioVideoBitrate( } void PerformTest() override { + // Quick test mode, just to exercise all the code paths without actually + // caring about performance measurements. + const bool quick_perf_test = + field_trial::IsEnabled("WebRTC-QuickPerfTest"); int last_passed_test_bitrate = -1; for (int test_bitrate = test_bitrate_from_; test_bitrate_from_ < test_bitrate_to_ @@ -916,14 +921,14 @@ void CallPerfTest::TestMinAudioVideoBitrate( receive_simulated_network_->SetConfig(pipe_config); rtc::ThreadManager::Instance()->CurrentThread()->SleepMs( - kBitrateStabilizationMs); + quick_perf_test ? kShortDelayMs : kBitrateStabilizationMs); int64_t avg_rtt = 0; for (int i = 0; i < kBitrateMeasurements; i++) { Call::Stats call_stats = sender_call_->GetStats(); avg_rtt += call_stats.rtt_ms; rtc::ThreadManager::Instance()->CurrentThread()->SleepMs( - kBitrateMeasurementMs); + quick_perf_test ? kShortDelayMs : kBitrateMeasurementMs); } avg_rtt = avg_rtt / kBitrateMeasurements; if (avg_rtt > kMinGoodRttMs) { diff --git a/video/full_stack_tests.cc b/video/full_stack_tests.cc index 81c0a513b8..05be0ef017 100644 --- a/video/full_stack_tests.cc +++ b/video/full_stack_tests.cc @@ -102,7 +102,7 @@ std::string AppendFieldTrials(std::string new_trial_string) { class GenericDescriptorTest : public ::testing::TestWithParam { public: GenericDescriptorTest() - : field_trial_(GetParam()), + : field_trial_(AppendFieldTrials(GetParam())), generic_descriptor_enabled_( field_trial::IsEnabled("WebRTC-GenericDescriptor")) {}