diff --git a/internal/platform/multi_thread_executor_test.cc b/internal/platform/multi_thread_executor_test.cc index 0085e05a..7166aa6a 100644 --- a/internal/platform/multi_thread_executor_test.cc +++ b/internal/platform/multi_thread_executor_test.cc @@ -28,7 +28,7 @@ namespace { const int kMaxThreads = 5; } -TEST(MultiThreadExecutorTest, ConsructorDestructorWorks) { +TEST(MultiThreadExecutorTest, ConstructorDestructorWorks) { MultiThreadExecutor executor(kMaxThreads); } @@ -58,7 +58,7 @@ TEST(MultiThreadExecutorTest, JobsExecuteInParallel) { int count = 0; for (int i = 0; i < kMaxThreads; ++i) { - executor.Execute([&count, &mutex, &test_cond, &thread_cond]() { + executor.Execute([&]() { absl::MutexLock lock(&mutex); count++; test_cond.Signal(); @@ -69,12 +69,9 @@ TEST(MultiThreadExecutorTest, JobsExecuteInParallel) { } { - absl::Duration duration = absl::Milliseconds(kMaxThreads * 100); absl::MutexLock lock(&mutex); while (count < kMaxThreads) { - absl::Time start = absl::Now(); - if (test_cond.WaitWithTimeout(&mutex, duration)) break; - duration -= absl::Now() - start; + if (test_cond.WaitWithTimeout(&mutex, absl::Seconds(30))) break; } } @@ -82,12 +79,9 @@ TEST(MultiThreadExecutorTest, JobsExecuteInParallel) { thread_cond.SignalAll(); { - absl::Duration duration = absl::Milliseconds(kMaxThreads * 100); absl::MutexLock lock(&mutex); while (count > 0) { - absl::Time start = absl::Now(); - if (test_cond.WaitWithTimeout(&mutex, duration)) break; - duration -= absl::Now() - start; + if (test_cond.WaitWithTimeout(&mutex, absl::Seconds(30))) break; } } EXPECT_EQ(count, 0); diff --git a/proto/connections_enums.proto b/proto/connections_enums.proto index c5d25ae5..072b4625 100644 --- a/proto/connections_enums.proto +++ b/proto/connections_enums.proto @@ -157,6 +157,7 @@ enum ConnectionAttemptType { UNKNOWN_CONNECTION_ATTEMPT_TYPE = 0; INITIAL = 1; UPGRADE = 2; + RECONNECT = 3; } // The reason that an EstablishedConnection was disconnected.