|
|
@ -339,11 +339,14 @@ TEST_F(FlakyNetworkTest, NetworkTransition) { |
|
|
|
TEST_F(FlakyNetworkTest, ServerUnreachableWithKeepalive) { |
|
|
|
TEST_F(FlakyNetworkTest, ServerUnreachableWithKeepalive) { |
|
|
|
const int kKeepAliveTimeMs = 1000; |
|
|
|
const int kKeepAliveTimeMs = 1000; |
|
|
|
const int kKeepAliveTimeoutMs = 1000; |
|
|
|
const int kKeepAliveTimeoutMs = 1000; |
|
|
|
|
|
|
|
const int kReconnectBackoffMs = 1000; |
|
|
|
ChannelArguments args; |
|
|
|
ChannelArguments args; |
|
|
|
args.SetInt(GRPC_ARG_KEEPALIVE_TIME_MS, kKeepAliveTimeMs); |
|
|
|
args.SetInt(GRPC_ARG_KEEPALIVE_TIME_MS, kKeepAliveTimeMs); |
|
|
|
args.SetInt(GRPC_ARG_KEEPALIVE_TIMEOUT_MS, kKeepAliveTimeoutMs); |
|
|
|
args.SetInt(GRPC_ARG_KEEPALIVE_TIMEOUT_MS, kKeepAliveTimeoutMs); |
|
|
|
args.SetInt(GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS, 1); |
|
|
|
args.SetInt(GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS, 1); |
|
|
|
args.SetInt(GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA, 0); |
|
|
|
args.SetInt(GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA, 0); |
|
|
|
|
|
|
|
args.SetInt(GRPC_ARG_INITIAL_RECONNECT_BACKOFF_MS, kReconnectBackoffMs); |
|
|
|
|
|
|
|
args.SetInt(GRPC_ARG_MAX_RECONNECT_BACKOFF_MS, kReconnectBackoffMs); |
|
|
|
|
|
|
|
|
|
|
|
auto channel = BuildChannel("pick_first", args); |
|
|
|
auto channel = BuildChannel("pick_first", args); |
|
|
|
auto stub = BuildStub(channel); |
|
|
|
auto stub = BuildStub(channel); |
|
|
@ -421,7 +424,7 @@ TEST_F(FlakyNetworkTest, FlakyNetwork) { |
|
|
|
// simulate flaky network (packet loss, corruption and delays)
|
|
|
|
// simulate flaky network (packet loss, corruption and delays)
|
|
|
|
FlakeNetwork(); |
|
|
|
FlakeNetwork(); |
|
|
|
for (int i = 0; i < kMessageCount; ++i) { |
|
|
|
for (int i = 0; i < kMessageCount; ++i) { |
|
|
|
EXPECT_TRUE(SendRpc(stub)); |
|
|
|
SendRpc(stub); |
|
|
|
} |
|
|
|
} |
|
|
|
// remove network flakiness
|
|
|
|
// remove network flakiness
|
|
|
|
UnflakeNetwork(); |
|
|
|
UnflakeNetwork(); |
|
|
|