Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Unified Diff: webrtc/modules/utility/source/process_thread_impl_unittest.cc

Issue 2308183002: Increase timeout for flaky tests for ProcessThreadImpl (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/utility/source/process_thread_impl_unittest.cc
diff --git a/webrtc/modules/utility/source/process_thread_impl_unittest.cc b/webrtc/modules/utility/source/process_thread_impl_unittest.cc
index 1fe3a417f89d89952a36a88effdd31f9b6c7a1bc..ec3b5a19093ddfacc5326e27f1a3edf8f8b7ce87 100644
--- a/webrtc/modules/utility/source/process_thread_impl_unittest.cc
+++ b/webrtc/modules/utility/source/process_thread_impl_unittest.cc
@@ -27,6 +27,11 @@ using ::testing::Invoke;
using ::testing::Return;
using ::testing::SetArgPointee;
+// The length of time, in milliseconds, to wait for an event to become signaled.
+// Set to a fairly large value as there is quite a bit of variation on some
+// Windows bots.
+static const int kEventWaitTimeout = 500;
+
class MockModule : public Module {
public:
MOCK_METHOD0(TimeUntilNextProcess, int64_t());
@@ -87,7 +92,7 @@ TEST(ProcessThreadImpl, ProcessCall) {
EXPECT_CALL(module, ProcessThreadAttached(&thread)).Times(1);
thread.RegisterModule(&module);
- EXPECT_EQ(kEventSignaled, event->Wait(100));
+ EXPECT_EQ(kEventSignaled, event->Wait(kEventWaitTimeout));
EXPECT_CALL(module, ProcessThreadAttached(nullptr)).Times(1);
thread.Stop();
@@ -109,7 +114,7 @@ TEST(ProcessThreadImpl, ProcessCall2) {
EXPECT_CALL(module, ProcessThreadAttached(&thread)).Times(1);
thread.Start();
- EXPECT_EQ(kEventSignaled, event->Wait(100));
+ EXPECT_EQ(kEventSignaled, event->Wait(kEventWaitTimeout));
EXPECT_CALL(module, ProcessThreadAttached(nullptr)).Times(1);
thread.Stop();
@@ -135,7 +140,7 @@ TEST(ProcessThreadImpl, Deregister) {
EXPECT_CALL(module, ProcessThreadAttached(&thread)).Times(1);
thread.Start();
- EXPECT_EQ(kEventSignaled, event->Wait(100));
+ EXPECT_EQ(kEventSignaled, event->Wait(kEventWaitTimeout));
EXPECT_CALL(module, ProcessThreadAttached(nullptr)).Times(1);
thread.DeRegisterModule(&module);
@@ -281,9 +286,9 @@ TEST(ProcessThreadImpl, WakeUp) {
EXPECT_CALL(module, ProcessThreadAttached(&thread)).Times(1);
thread.RegisterModule(&module);
- EXPECT_EQ(kEventSignaled, started->Wait(100));
+ EXPECT_EQ(kEventSignaled, started->Wait(kEventWaitTimeout));
thread.WakeUp(&module);
- EXPECT_EQ(kEventSignaled, called->Wait(100));
+ EXPECT_EQ(kEventSignaled, called->Wait(kEventWaitTimeout));
EXPECT_CALL(module, ProcessThreadAttached(nullptr)).Times(1);
thread.Stop();
@@ -302,7 +307,7 @@ TEST(ProcessThreadImpl, PostTask) {
std::unique_ptr<RaiseEventTask> task(new RaiseEventTask(task_ran.get()));
thread.Start();
thread.PostTask(std::move(task));
- EXPECT_EQ(kEventSignaled, task_ran->Wait(100));
+ EXPECT_EQ(kEventSignaled, task_ran->Wait(kEventWaitTimeout));
thread.Stop();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698