Make scenario unittests faster.

They now run in 3 seconds rather than 45 or whatever it was before.

The tests still pass (and I tried with gtest_repeat=25), so I think
the shorter time is sufficient to prove the code works and doesn't
crash. Unit tests need to be fast. I think it's unlikely a longer
runtime would make this test a better correctness test, but let me
know if there's something in particular with this code that needs
the longer runtime.

Bug: None
Change-Id: I3f4213718870a1772f7a19e3c418634031c46de3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168884
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30569}
This commit is contained in:
Patrik Höglund
2020-02-20 12:07:29 +01:00
committed by Commit Bot
parent 2e161c4dd6
commit cdda76d1c8

View File

@ -101,7 +101,7 @@ TEST(ScenarioTest, MAYBE_SimTimeEncoding) {
{ {
Scenario s("scenario/encode_sim", false); Scenario s("scenario/encode_sim", false);
SetupVideoCall(s, &analyzer); SetupVideoCall(s, &analyzer);
s.RunFor(TimeDelta::Seconds(60)); s.RunFor(TimeDelta::Seconds(2));
} }
// Regression tests based on previous runs. // Regression tests based on previous runs.
EXPECT_EQ(analyzer.stats().lost_count, 0); EXPECT_EQ(analyzer.stats().lost_count, 0);
@ -121,7 +121,7 @@ TEST(ScenarioTest, MAYBE_RealTimeEncoding) {
{ {
Scenario s("scenario/encode_real", true); Scenario s("scenario/encode_real", true);
SetupVideoCall(s, &analyzer); SetupVideoCall(s, &analyzer);
s.RunFor(TimeDelta::Seconds(10)); s.RunFor(TimeDelta::Seconds(2));
} }
// Regression tests based on previous runs. // Regression tests based on previous runs.
EXPECT_LT(analyzer.stats().lost_count, 2); EXPECT_LT(analyzer.stats().lost_count, 2);
@ -131,7 +131,7 @@ TEST(ScenarioTest, MAYBE_RealTimeEncoding) {
TEST(ScenarioTest, SimTimeFakeing) { TEST(ScenarioTest, SimTimeFakeing) {
Scenario s("scenario/encode_sim", false); Scenario s("scenario/encode_sim", false);
SetupVideoCall(s, nullptr); SetupVideoCall(s, nullptr);
s.RunFor(TimeDelta::Seconds(10)); s.RunFor(TimeDelta::Seconds(2));
} }
TEST(ScenarioTest, WritesToRtcEventLog) { TEST(ScenarioTest, WritesToRtcEventLog) {