Skip to content

Commit

Permalink
pickfirst: Ensure pickfirst_test.go runs against both new and old pol…
Browse files Browse the repository at this point in the history
…icies
  • Loading branch information
arjan-bal authored Nov 20, 2024
1 parent 0775031 commit 7d53957
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions balancer/pickfirst/pickfirst_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ func Test(t *testing.T) {
grpctest.RunSubTests(t, s{})
}

// TestPickFirstLeaf_InitialResolverError sends a resolver error to the balancer
// TestPickFirst_InitialResolverError sends a resolver error to the balancer
// before a valid resolver update. It verifies that the clientconn state is
// updated to TRANSIENT_FAILURE.
func (s) TestPickFirstLeaf_InitialResolverError(t *testing.T) {
func (s) TestPickFirst_InitialResolverError(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout)
defer cancel()
cc := testutils.NewBalancerClientConn(t)
bal := pickfirstBuilder{}.Build(cc, balancer.BuildOptions{})
bal := balancer.Get(Name).Build(cc, balancer.BuildOptions{})
defer bal.Close()
bal.ResolverError(errors.New("resolution failed: test error"))

Expand All @@ -81,14 +81,14 @@ func (s) TestPickFirstLeaf_InitialResolverError(t *testing.T) {
}
}

// TestPickFirstLeaf_ResolverErrorinTF sends a resolver error to the balancer
// TestPickFirst_ResolverErrorinTF sends a resolver error to the balancer
// before when it's attempting to connect to a SubConn TRANSIENT_FAILURE. It
// verifies that the picker is updated and the SubConn is not closed.
func (s) TestPickFirstLeaf_ResolverErrorinTF(t *testing.T) {
func (s) TestPickFirst_ResolverErrorinTF(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout)
defer cancel()
cc := testutils.NewBalancerClientConn(t)
bal := pickfirstBuilder{}.Build(cc, balancer.BuildOptions{})
bal := balancer.Get(Name).Build(cc, balancer.BuildOptions{})
defer bal.Close()

// After sending a valid update, the LB policy should report CONNECTING.
Expand Down

0 comments on commit 7d53957

Please sign in to comment.