|
|
|
@ -55,8 +55,8 @@ class ConfigurationTest : public ::testing::Test { |
|
|
|
|
|
|
|
|
|
TEST_F(ConfigurationTest, ClientKeepaliveDefaults) { |
|
|
|
|
ExecCtx exec_ctx; |
|
|
|
|
grpc_chttp2_transport* t = reinterpret_cast<grpc_chttp2_transport*>( |
|
|
|
|
grpc_create_chttp2_transport( |
|
|
|
|
grpc_chttp2_transport* t = |
|
|
|
|
reinterpret_cast<grpc_chttp2_transport*>(grpc_create_chttp2_transport( |
|
|
|
|
args_, mock_endpoint_controller_->TakeCEndpoint(), |
|
|
|
|
/*is_client=*/true)); |
|
|
|
|
EXPECT_EQ(t->keepalive_time, Duration::Infinity()); |
|
|
|
@ -72,8 +72,8 @@ TEST_F(ConfigurationTest, ClientKeepaliveExplicitArgs) { |
|
|
|
|
args_ = args_.Set(GRPC_ARG_KEEPALIVE_TIMEOUT_MS, 10000); |
|
|
|
|
args_ = args_.Set(GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS, true); |
|
|
|
|
args_ = args_.Set(GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA, 3); |
|
|
|
|
grpc_chttp2_transport* t = reinterpret_cast<grpc_chttp2_transport*>( |
|
|
|
|
grpc_create_chttp2_transport( |
|
|
|
|
grpc_chttp2_transport* t = |
|
|
|
|
reinterpret_cast<grpc_chttp2_transport*>(grpc_create_chttp2_transport( |
|
|
|
|
args_, mock_endpoint_controller_->TakeCEndpoint(), |
|
|
|
|
/*is_client=*/true)); |
|
|
|
|
EXPECT_EQ(t->keepalive_time, Duration::Seconds(20)); |
|
|
|
@ -85,8 +85,8 @@ TEST_F(ConfigurationTest, ClientKeepaliveExplicitArgs) { |
|
|
|
|
|
|
|
|
|
TEST_F(ConfigurationTest, ServerKeepaliveDefaults) { |
|
|
|
|
ExecCtx exec_ctx; |
|
|
|
|
grpc_chttp2_transport* t = reinterpret_cast<grpc_chttp2_transport*>( |
|
|
|
|
grpc_create_chttp2_transport( |
|
|
|
|
grpc_chttp2_transport* t = |
|
|
|
|
reinterpret_cast<grpc_chttp2_transport*>(grpc_create_chttp2_transport( |
|
|
|
|
args_, mock_endpoint_controller_->TakeCEndpoint(), |
|
|
|
|
/*is_client=*/false)); |
|
|
|
|
EXPECT_EQ(t->keepalive_time, Duration::Hours(2)); |
|
|
|
@ -109,8 +109,8 @@ TEST_F(ConfigurationTest, ServerKeepaliveExplicitArgs) { |
|
|
|
|
args_ = |
|
|
|
|
args_.Set(GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS, 20000); |
|
|
|
|
args_ = args_.Set(GRPC_ARG_HTTP2_MAX_PING_STRIKES, 0); |
|
|
|
|
grpc_chttp2_transport* t = reinterpret_cast<grpc_chttp2_transport*>( |
|
|
|
|
grpc_create_chttp2_transport( |
|
|
|
|
grpc_chttp2_transport* t = |
|
|
|
|
reinterpret_cast<grpc_chttp2_transport*>(grpc_create_chttp2_transport( |
|
|
|
|
args_, mock_endpoint_controller_->TakeCEndpoint(), |
|
|
|
|
/*is_client=*/false)); |
|
|
|
|
EXPECT_EQ(t->keepalive_time, Duration::Seconds(20)); |
|
|
|
@ -138,8 +138,8 @@ TEST_F(ConfigurationTest, ModifyClientDefaults) { |
|
|
|
|
grpc_chttp2_config_default_keepalive_args(args, /*is_client=*/true); |
|
|
|
|
// Note that we are using the original args_ object for creating the transport
|
|
|
|
|
// which does not override the defaults.
|
|
|
|
|
grpc_chttp2_transport* t = reinterpret_cast<grpc_chttp2_transport*>( |
|
|
|
|
grpc_create_chttp2_transport( |
|
|
|
|
grpc_chttp2_transport* t = |
|
|
|
|
reinterpret_cast<grpc_chttp2_transport*>(grpc_create_chttp2_transport( |
|
|
|
|
args_, mock_endpoint_controller_->TakeCEndpoint(), |
|
|
|
|
/*is_client=*/true)); |
|
|
|
|
EXPECT_EQ(t->keepalive_time, Duration::Seconds(20)); |
|
|
|
@ -165,8 +165,8 @@ TEST_F(ConfigurationTest, ModifyServerDefaults) { |
|
|
|
|
grpc_chttp2_config_default_keepalive_args(args, /*is_client=*/false); |
|
|
|
|
// Note that we are using the original args_ object for creating the transport
|
|
|
|
|
// which does not override the defaults.
|
|
|
|
|
grpc_chttp2_transport* t = reinterpret_cast<grpc_chttp2_transport*>( |
|
|
|
|
grpc_create_chttp2_transport( |
|
|
|
|
grpc_chttp2_transport* t = |
|
|
|
|
reinterpret_cast<grpc_chttp2_transport*>(grpc_create_chttp2_transport( |
|
|
|
|
args_, mock_endpoint_controller_->TakeCEndpoint(), |
|
|
|
|
/*is_client=*/false)); |
|
|
|
|
EXPECT_EQ(t->keepalive_time, Duration::Seconds(20)); |
|
|
|
|