Skip to content

Commit

Permalink
clusterresolver: fix a flaky test (#6499)
Browse files Browse the repository at this point in the history
  • Loading branch information
easwars authored Aug 3, 2023
1 parent b9356e3 commit ecc5645
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,11 @@ func (s) TestErrorFromParentLB_ResourceNotFound(t *testing.T) {
t.Fatalf("RPCs did not fail after removal of Cluster resource")
}

// Ensure that the ClientConn is in TransientFailure.
if state := cc.GetState(); state != connectivity.TransientFailure {
t.Fatalf("Unexpected connectivity state for ClientConn, got: %s, want %s", state, connectivity.TransientFailure)
// Ensure that the ClientConn moves to TransientFailure.
for state := cc.GetState(); state != connectivity.TransientFailure; state = cc.GetState() {
if !cc.WaitForStateChange(ctx, state) {
t.Fatalf("Timed out waiting for state change. got %v; want %v", state, connectivity.TransientFailure)
}
}

// Configure cluster and endpoints resources in the management server.
Expand Down

0 comments on commit ecc5645

Please sign in to comment.