@@ -725,10 +725,10 @@ public void successRateTwoOutliers() {
725725 }
726726
727727 /**
728- * Two outliers get ejected with default stdevFactor.
728+ * One then two outliers get ejected with default stdevFactor.
729729 */
730730 @ Test
731- public void successRateTwoOutliersWithDefaultStdevFactor () {
731+ public void successRateOneThenTwoOutliersWithDefaultStdevFactor () {
732732 OutlierDetectionLoadBalancerConfig config = new OutlierDetectionLoadBalancerConfig .Builder ()
733733 .setMaxEjectionPercent (50 )
734734 .setSuccessRateEjection (
@@ -741,14 +741,24 @@ public void successRateTwoOutliersWithDefaultStdevFactor() {
741741
742742 loadBalancer .acceptResolvedAddresses (buildResolvedAddress (config , servers ));
743743
744+ // One endpoint is failing
745+ generateLoad (ImmutableMap .of (subchannel1 , Status .DEADLINE_EXCEEDED ), 7 );
746+
747+ // Move forward in time to a point where the detection timer has fired.
748+ forwardTime (config );
749+
750+ // The one subchannel that was returning errors should be ejected.
751+ assertEjectedSubchannels (ImmutableSet .of (ImmutableSet .of (servers .get (0 ).getAddresses ().get (0 ))));
752+
753+ // Two endpoints are failing
744754 generateLoad (ImmutableMap .of (
745755 subchannel1 , Status .DEADLINE_EXCEEDED ,
746- subchannel2 , Status .DEADLINE_EXCEEDED ), 7 );
756+ subchannel2 , Status .DEADLINE_EXCEEDED ), 12 );
747757
748758 // Move forward in time to a point where the detection timer has fired.
749759 forwardTime (config );
750760
751- // The one subchannel that was returning errors should be ejected.
761+ // Both subchannels that were returning errors should be ejected.
752762 assertEjectedSubchannels (ImmutableSet .of (ImmutableSet .of (servers .get (0 ).getAddresses ().get (0 )),
753763 ImmutableSet .of (servers .get (1 ).getAddresses ().get (0 ))));
754764 }
0 commit comments