| 248 | } |
| 249 | |
| 250 | func (s *proxyTestSuite) TestDirectorErrorIsPropagated() { |
| 251 | ctx, cancel := s.ctx() |
| 252 | defer cancel() |
| 253 | // See SetupSuite where the StreamDirector has a special case. |
| 254 | ctx = metadata.NewOutgoingContext(ctx, metadata.Pairs(rejectingMdKey, "true")) |
| 255 | _, err := s.testClient.Ping(ctx, &pb.PingRequest{Value: "foo"}) |
| 256 | s.Require().Error(err, "Director should reject this RPC") |
| 257 | st, ok := status.FromError(err) |
| 258 | s.Require().True(ok, "must get status from error") |
| 259 | s.Equal(codes.PermissionDenied, st.Code()) |
| 260 | s.Equal("testing rejection", st.Message()) |
| 261 | } |
| 262 | |
| 263 | func (s *proxyTestSuite) TestPingStream_FullDuplexWorks() { |
| 264 | ctx, cancel := context.WithTimeout(context.Background(), time.Minute) |