Skip to content

Commit

Permalink
[rls_e2e_test] increase RPC timeout (grpc#37708)
Browse files Browse the repository at this point in the history
  • Loading branch information
markdroth authored and copybara-github committed Sep 12, 2024
1 parent e9046b2 commit 57ba118
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/cpp/end2end/rls_end2end_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ class RlsEnd2endTest : public ::testing::Test {
}

struct RpcOptions {
int timeout_ms = 2000;
int timeout_ms = 5000;
bool wait_for_ready = false;
std::vector<std::pair<std::string, std::string>> metadata;

Expand Down Expand Up @@ -922,14 +922,15 @@ TEST_F(RlsEnd2endTest, RlsRequestTimeout) {
.set_default_target(grpc_core::LocalIpUri(backends_[1]->port_))
.set_lookup_service_timeout(grpc_core::Duration::Seconds(2))
.Build());
// RLS server will send a response, but it's longer than the timeout.
// RLS server will send a response, but it takes longer than the
// timeout set in the LB policy config.
rls_server_->service_.SetResponse(
BuildRlsRequest({{kTestKey, kTestValue}}),
BuildRlsResponse({grpc_core::LocalIpUri(backends_[0]->port_)}),
/*response_delay=*/grpc_core::Duration::Seconds(3));
// The data plane RPC should be sent to the default target.
CheckRpcSendOk(DEBUG_LOCATION, RpcOptions().set_timeout_ms(4000).set_metadata(
{{"key1", kTestValue}}));
CheckRpcSendOk(DEBUG_LOCATION,
RpcOptions().set_metadata({{"key1", kTestValue}}));
EXPECT_EQ(rls_server_->service_.request_count(), 1);
EXPECT_EQ(backends_[0]->service_.request_count(), 0);
EXPECT_EQ(backends_[1]->service_.request_count(), 1);
Expand Down

0 comments on commit 57ba118

Please sign in to comment.