Skip to content

Commit

Permalink
fix OD tests
Browse files Browse the repository at this point in the history
  • Loading branch information
markdroth committed Sep 17, 2024
1 parent 2a8820f commit 01a4a2e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/core/load_balancing/outlier_detection_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ TEST_F(OutlierDetectionTest, FailurePercentage) {
// Advance time and run the timer callback to trigger ejection.
IncrementTimeBy(Duration::Seconds(10));
RunTimerCallback();
WaitForWorkSerializerToFlush();
LOG(INFO) << "### ejection complete";
// Expect a picker update.
std::vector<absl::string_view> remaining_addresses;
Expand All @@ -234,6 +235,7 @@ TEST_F(OutlierDetectionTest, FailurePercentage) {
// Advance time and run the timer callback to trigger un-ejection.
IncrementTimeBy(Duration::Seconds(10));
RunTimerCallback();
WaitForWorkSerializerToFlush();
LOG(INFO) << "### un-ejection complete";
// Expect a picker update.
WaitForRoundRobinListChange(remaining_addresses, kAddresses);
Expand Down Expand Up @@ -301,6 +303,7 @@ TEST_F(OutlierDetectionTest, MultipleAddressesPerEndpoint) {
// Advance time and run the timer callback to trigger ejection.
IncrementTimeBy(Duration::Seconds(10));
RunTimerCallback();
WaitForWorkSerializerToFlush();
LOG(INFO) << "### ejection complete";
// Expect a picker that removes the ejected address.
WaitForRoundRobinListChange(
Expand Down Expand Up @@ -332,6 +335,7 @@ TEST_F(OutlierDetectionTest, MultipleAddressesPerEndpoint) {
// Advance time and run the timer callback to trigger un-ejection.
IncrementTimeBy(Duration::Seconds(10));
RunTimerCallback();
WaitForWorkSerializerToFlush();
LOG(INFO) << "### un-ejection complete";
// The ejected endpoint should come back using the new address.
WaitForRoundRobinListChange(
Expand Down Expand Up @@ -399,6 +403,7 @@ TEST_F(OutlierDetectionTest, EjectionStateResetsWhenEndpointAddressesChange) {
// Advance time and run the timer callback to trigger ejection.
IncrementTimeBy(Duration::Seconds(10));
RunTimerCallback();
WaitForWorkSerializerToFlush();
LOG(INFO) << "### ejection complete";
// Expect a picker that removes the ejected address.
WaitForRoundRobinListChange(
Expand Down Expand Up @@ -461,6 +466,7 @@ TEST_F(OutlierDetectionTest, DoesNotWorkWithPickFirst) {
// Advance time and run the timer callback to trigger ejection.
IncrementTimeBy(Duration::Seconds(10));
RunTimerCallback();
WaitForWorkSerializerToFlush();
LOG(INFO) << "### ejection timer pass complete";
// Subchannel should not be ejected.
ExpectQueueEmpty();
Expand Down

0 comments on commit 01a4a2e

Please sign in to comment.