diff --git a/test/extensions/quic_listeners/quiche/active_quic_listener_test.cc b/test/extensions/quic_listeners/quiche/active_quic_listener_test.cc index ebfba7f3b464..03e32d788b62 100644 --- a/test/extensions/quic_listeners/quiche/active_quic_listener_test.cc +++ b/test/extensions/quic_listeners/quiche/active_quic_listener_test.cc @@ -42,8 +42,7 @@ class ActiveQuicListenerPeer { } }; -class ActiveQuicListenerTest : public testing::TestWithParam, - protected Logger::Loggable { +class ActiveQuicListenerTest : public testing::TestWithParam { public: ActiveQuicListenerTest() : version_(GetParam()), api_(Api::createApiForTest(simulated_time_system_)), diff --git a/test/integration/integration_test.cc b/test/integration/integration_test.cc index 66496cf06e06..f42e5c11debf 100644 --- a/test/integration/integration_test.cc +++ b/test/integration/integration_test.cc @@ -53,6 +53,10 @@ INSTANTIATE_TEST_SUITE_P(IpVersions, IntegrationTest, TestUtility::ipTestParamsToString); // Make sure we have correctly specified per-worker performance stats. +// TODO(mattklein123): We should flesh this test out to a) actually use more than 1 worker and +// b) do some real requests and verify things work correctly on a per-worker basis. I will do this +// in my next change when I add optional CX balancing as it well then be easier to write a +// deterministic test. TEST_P(IntegrationTest, PerWorkerStats) { initialize(); diff --git a/test/server/guarddog_impl_test.cc b/test/server/guarddog_impl_test.cc index 5d04fe52bc5e..011ba8dbfcb8 100644 --- a/test/server/guarddog_impl_test.cc +++ b/test/server/guarddog_impl_test.cc @@ -197,17 +197,21 @@ class GuardDogMissTest : public GuardDogTestBase { protected: GuardDogMissTest() : config_miss_(500, 1000, 0, 0), config_mega_(1000, 500, 0, 0) {} - void checkMiss(uint64_t count) { - EXPECT_EQ(count, TestUtility::findCounter(stats_store_, "server.watchdog_miss")->value()); + void checkMiss(uint64_t count, const std::string& descriptor) { + EXPECT_EQ(count, TestUtility::findCounter(stats_store_, "server.watchdog_miss")->value()) + << descriptor; EXPECT_EQ(count, - TestUtility::findCounter(stats_store_, "server.test_thread.watchdog_miss")->value()); + TestUtility::findCounter(stats_store_, "server.test_thread.watchdog_miss")->value()) + << descriptor; } - void checkMegaMiss(uint64_t count) { - EXPECT_EQ(count, TestUtility::findCounter(stats_store_, "server.watchdog_mega_miss")->value()); + void checkMegaMiss(uint64_t count, const std::string& descriptor) { + EXPECT_EQ(count, TestUtility::findCounter(stats_store_, "server.watchdog_mega_miss")->value()) + << descriptor; EXPECT_EQ( count, - TestUtility::findCounter(stats_store_, "server.test_thread.watchdog_mega_miss")->value()); + TestUtility::findCounter(stats_store_, "server.test_thread.watchdog_mega_miss")->value()) + << descriptor; } NiceMock config_miss_; @@ -224,15 +228,15 @@ TEST_P(GuardDogMissTest, MissTest) { auto unpet_dog = guard_dog_->createWatchDog(api_->threadFactory().currentThreadId(), "test_thread"); // We'd better start at 0: - checkMiss(0); + checkMiss(0, "MissTest check 1"); // At 300ms we shouldn't have hit the timeout yet: time_system_->sleep(std::chrono::milliseconds(300)); guard_dog_->forceCheckForTest(); - checkMiss(0); + checkMiss(0, "MissTest check 2"); // This should push it past the 500ms limit: time_system_->sleep(std::chrono::milliseconds(250)); guard_dog_->forceCheckForTest(); - checkMiss(1); + checkMiss(1, "MissTest check 3"); guard_dog_->stopWatching(unpet_dog); unpet_dog = nullptr; } @@ -249,15 +253,15 @@ TEST_P(GuardDogMissTest, MegaMissTest) { auto unpet_dog = guard_dog_->createWatchDog(api_->threadFactory().currentThreadId(), "test_thread"); // We'd better start at 0: - checkMegaMiss(0); + checkMegaMiss(0, "MegaMissTest check 1"); // This shouldn't be enough to increment the stat: time_system_->sleep(std::chrono::milliseconds(499)); guard_dog_->forceCheckForTest(); - checkMegaMiss(0); + checkMegaMiss(0, "MegaMissTest check 2"); // Just 2ms more will make it greater than 500ms timeout: time_system_->sleep(std::chrono::milliseconds(2)); guard_dog_->forceCheckForTest(); - checkMegaMiss(1); + checkMegaMiss(1, "MegaMissTest check 3"); guard_dog_->stopWatching(unpet_dog); unpet_dog = nullptr; } @@ -282,17 +286,17 @@ TEST_P(GuardDogMissTest, MissCountTest) { // This shouldn't be enough to increment the stat: time_system_->sleep(std::chrono::milliseconds(499)); guard_dog_->forceCheckForTest(); - checkMiss(i); + checkMiss(i, "MissCountTest check 1"); // And if we force re-execution of the loop it still shouldn't be: guard_dog_->forceCheckForTest(); - checkMiss(i); + checkMiss(i, "MissCountTest check 2"); // Just 2ms more will make it greater than 500ms timeout: time_system_->sleep(std::chrono::milliseconds(2)); guard_dog_->forceCheckForTest(); - checkMiss(i + 1); + checkMiss(i + 1, "MissCountTest check 3"); // Spurious wakeup, we should still only have one miss counted. guard_dog_->forceCheckForTest(); - checkMiss(i + 1); + checkMiss(i + 1, "MissCountTest check 4"); // When we finally touch the dog we should get one more increment once the // timeout value expires: sometimes_pet_dog->touch(); @@ -300,10 +304,10 @@ TEST_P(GuardDogMissTest, MissCountTest) { time_system_->sleep(std::chrono::milliseconds(1000)); sometimes_pet_dog->touch(); // Make sure megamiss still works: - checkMegaMiss(0UL); + checkMegaMiss(0UL, "MissCountTest check 5"); time_system_->sleep(std::chrono::milliseconds(1500)); guard_dog_->forceCheckForTest(); - checkMegaMiss(1UL); + checkMegaMiss(1UL, "MissCountTest check 6"); guard_dog_->stopWatching(sometimes_pet_dog); sometimes_pet_dog = nullptr;