From d9611cf1ca60e3d9bb1c5d37657fe9aef22c42c6 Mon Sep 17 00:00:00 2001 From: Donna Dionne Date: Wed, 8 Apr 2020 16:20:16 -0700 Subject: [PATCH] Fixed AllServerUnavailableFailFast test to return UNAVAILBLE instead UNKNOWN. --- .../ext/filters/client_channel/lb_policy/xds/xds_routing.cc | 4 ++-- test/cpp/end2end/xds_end2end_test.cc | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/xds/xds_routing.cc b/src/core/ext/filters/client_channel/lb_policy/xds/xds_routing.cc index 7098b9ae9db..19542fc8b3a 100644 --- a/src/core/ext/filters/client_channel/lb_policy/xds/xds_routing.cc +++ b/src/core/ext/filters/client_channel/lb_policy/xds/xds_routing.cc @@ -393,8 +393,8 @@ void XdsRoutingLb::UpdateStateLocked() { break; default: picker = absl::make_unique( - GRPC_ERROR_CREATE_FROM_STATIC_STRING( - "xds_routing: all children report state TRANSIENT_FAILURE")); + grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING("TRANSIENT_FAILURE from XdsRoutingLb"), + GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE)); } channel_control_helper()->UpdateState(connectivity_state, std::move(picker)); } diff --git a/test/cpp/end2end/xds_end2end_test.cc b/test/cpp/end2end/xds_end2end_test.cc index 5b86667ca67..cb86de8aa86 100644 --- a/test/cpp/end2end/xds_end2end_test.cc +++ b/test/cpp/end2end/xds_end2end_test.cc @@ -1748,9 +1748,7 @@ TEST_P(BasicTest, AllServersUnreachableFailFast) { AdsServiceImpl::BuildEdsResource(args), kDefaultResourceName); const Status status = SendRpc(); // The error shouldn't be DEADLINE_EXCEEDED. - gpr_log(GPR_INFO, "error code %d message received %s", status.error_code(), - status.error_message().c_str()); - EXPECT_NE(StatusCode::DEADLINE_EXCEEDED, status.error_code()); + EXPECT_EQ(StatusCode::UNAVAILABLE, status.error_code()); } // Tests that RPCs fail when the backends are down, and will succeed again after