Fixing flake in AllServerUnavailbleFailFast by increasing the RPC (#26015)

timeout from 1 second to 5: this ensures there is enough time for
communication with xDS server to get established.
reviewable/pr25948/r1
donnadionne 4 years ago committed by GitHub
parent 5bce484c35
commit 89f7e53dbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      test/cpp/end2end/xds_end2end_test.cc

@ -2707,6 +2707,9 @@ TEST_P(BasicTest, InitiallyEmptyServerlist) {
// Tests that RPCs will fail with UNAVAILABLE instead of DEADLINE_EXCEEDED if
// all the servers are unreachable.
TEST_P(BasicTest, AllServersUnreachableFailFast) {
// Set Rpc timeout to 5 seconds to ensure there is enough time
// for communication with the xDS server to take place upon test start up.
const uint32_t kRpcTimeoutMs = 5000;
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
const size_t kNumUnreachableServers = 5;
@ -2719,8 +2722,10 @@ TEST_P(BasicTest, AllServersUnreachableFailFast) {
});
balancers_[0]->ads_service()->SetEdsResource(
BuildEdsResource(args, DefaultEdsServiceName()));
const Status status = SendRpc();
// The error shouldn't be DEADLINE_EXCEEDED.
const Status status = SendRpc(RpcOptions().set_timeout_ms(kRpcTimeoutMs));
// The error shouldn't be DEADLINE_EXCEEDED because timeout is set to 5
// seconds, and we should disocver in that time that the target backend is
// down.
EXPECT_EQ(StatusCode::UNAVAILABLE, status.error_code());
}

Loading…
Cancel
Save