Skip to content

Commit

Permalink
rls: return status error from server interceptor in test (#5153)
Browse files Browse the repository at this point in the history
  • Loading branch information
easwars committed Jan 20, 2022
1 parent 61a352e commit f93e8e6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions balancer/rls/control_channel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,9 @@ func (s) TestLookupFailure(t *testing.T) {
// TestLookupDeadlineExceeded tests the case where the RLS server does not
// respond within the configured rpc timeout.
func (s) TestLookupDeadlineExceeded(t *testing.T) {
// A unary interceptor which blocks until the test is done.
// A unary interceptor which returns a status error with DeadlineExceeded.
interceptor := func(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) {
<-ctx.Done()
return nil, ctx.Err()
return nil, status.Error(codes.DeadlineExceeded, "deadline exceeded")
}

// Start an RLS server and set the throttler to never throttle.
Expand Down

0 comments on commit f93e8e6

Please sign in to comment.