add checks for ejections_unenforced in test

This commit is contained in:
Pardhu Konakanchi 2025-07-08 11:30:02 -04:00
parent 7cd46ea184
commit dc641b12c0
1 changed files with 6 additions and 0 deletions

View File

@ -1175,6 +1175,9 @@ func (s) TestEjectUnejectSuccessRate(t *testing.T) {
if got, _ := tmr.Metric("grpc.lb.outlier_detection.ejections_enforced"); got != 0 { if got, _ := tmr.Metric("grpc.lb.outlier_detection.ejections_enforced"); got != 0 {
t.Errorf("Metric grpc.lb.outlier_detection.ejections_enforced: got %v, want 0", got) t.Errorf("Metric grpc.lb.outlier_detection.ejections_enforced: got %v, want 0", got)
} }
if got, _ := tmr.Metric("grpc.lb.outlier_detection.ejections_unenforced"); got != 0 {
t.Errorf("Metric grpc.lb.outlier_detection.ejections_unenforced: got %v, want 0", got)
}
// Since no addresses are ejected, a SubConn update should forward down // Since no addresses are ejected, a SubConn update should forward down
// to the child. // to the child.
@ -1244,6 +1247,9 @@ func (s) TestEjectUnejectSuccessRate(t *testing.T) {
if got, _ := tmr.Metric("grpc.lb.outlier_detection.ejections_enforced"); got != 1 { if got, _ := tmr.Metric("grpc.lb.outlier_detection.ejections_enforced"); got != 1 {
t.Errorf("Metric grpc.lb.outlier_detection.ejections_enforced: got %v, want 1", got) t.Errorf("Metric grpc.lb.outlier_detection.ejections_enforced: got %v, want 1", got)
} }
if got, _ := tmr.Metric("grpc.lb.outlier_detection.ejections_unenforced"); got != 0 {
t.Errorf("Metric grpc.lb.outlier_detection.ejections_unenforced: got %v, want 0", got)
}
// Now that an address is ejected, SubConn updates for SubConns using // Now that an address is ejected, SubConn updates for SubConns using
// that address should not be forwarded downward. These SubConn updates // that address should not be forwarded downward. These SubConn updates