From 65eb9c9ddb188bddaf5b2a1fa2f04812903b7337 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Fri, 30 Aug 2019 08:14:44 -0700 Subject: [PATCH] Revert "Test message size of 100MB" --- test/core/util/test_config.cc | 4 --- test/core/util/test_config.h | 3 -- test/cpp/end2end/async_end2end_test.cc | 38 ++++---------------------- 3 files changed, 6 insertions(+), 39 deletions(-) diff --git a/test/core/util/test_config.cc b/test/core/util/test_config.cc index 5033dc7b66a..5b248a01daa 100644 --- a/test/core/util/test_config.cc +++ b/test/core/util/test_config.cc @@ -342,10 +342,6 @@ bool BuiltUnderUbsan() { #endif } -bool grpc_test_built_under_tsan_or_msan() { - return BuiltUnderTsan() || BuiltUnderMsan(); -}; - int64_t grpc_test_sanitizer_slowdown_factor() { int64_t sanitizer_multiplier = 1; if (BuiltUnderValgrind()) { diff --git a/test/core/util/test_config.h b/test/core/util/test_config.h index 905d61f1dd6..112af3176f9 100644 --- a/test/core/util/test_config.h +++ b/test/core/util/test_config.h @@ -24,9 +24,6 @@ extern int64_t g_fixture_slowdown_factor; extern int64_t g_poller_slowdown_factor; -/* Returns if the test is built under TSAN or MSAN. */ -bool grpc_test_built_under_tsan_or_msan(); - /* Returns an appropriate scaling factor for timeouts. */ int64_t grpc_test_slowdown_factor(); diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc index 879f16815ee..6ca0edf123e 100644 --- a/test/cpp/end2end/async_end2end_test.cc +++ b/test/cpp/end2end/async_end2end_test.cc @@ -34,7 +34,6 @@ #include "src/core/ext/filters/client_channel/backup_poller.h" #include "src/core/lib/gpr/tls.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/iomgr/port.h" #include "src/proto/grpc/health/v1/health.grpc.pb.h" #include "src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h" @@ -60,18 +59,6 @@ namespace testing { namespace { -const size_t MAX_TEST_MESSAGE_SIZE = -#if defined(GPR_APPLE) - // The test will time out with macos build. - GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH; -#else - // Don't test extreme size under tsan or msan, because it uses too much - // memory. - grpc_test_built_under_tsan_or_msan() - ? GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH - : GPR_MAX(100 * 1024 * 1024, GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH); -#endif - void* tag(int i) { return (void*)static_cast(i); } int detag(void* p) { return static_cast(reinterpret_cast(p)); } @@ -231,17 +218,6 @@ class ServerBuilderSyncPluginDisabler : public ::grpc::ServerBuilderOption { } }; -class ServerBuilderMaxRecvMessageSizeOption - : public ::grpc::ServerBuilderOption { - public: - void UpdateArguments(ChannelArguments* arg) override { - arg->SetInt(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH, -1); - } - - void UpdatePlugins( - std::vector>* plugins) override {} -}; - class TestScenario { public: TestScenario(bool inproc_stub, const grpc::string& creds_type, bool hcs, @@ -314,9 +290,6 @@ class AsyncEnd2endTest : public ::testing::TestWithParam { std::unique_ptr sync_plugin_disabler( new ServerBuilderSyncPluginDisabler()); builder.SetOption(move(sync_plugin_disabler)); - std::unique_ptr max_recv_option( - new ServerBuilderMaxRecvMessageSizeOption()); - builder.SetOption(move(max_recv_option)); server_ = builder.BuildAndStart(); } @@ -324,7 +297,6 @@ class AsyncEnd2endTest : public ::testing::TestWithParam { ChannelArguments args; auto channel_creds = GetCredentialsProvider()->GetChannelCredentials( GetParam().credentials_type, &args); - args.SetInt(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH, -1); std::shared_ptr channel = !(GetParam().inproc) ? ::grpc::CreateCustomChannel( server_address_.str(), channel_creds, args) @@ -1850,7 +1822,7 @@ TEST_P(AsyncEnd2endServerTryCancelTest, ServerBidiStreamingTryCancelAfter) { } std::vector CreateTestScenarios(bool test_secure, - bool test_big_message) { + bool test_message_size_limit) { std::vector scenarios; std::vector credentials_types; std::vector messages; @@ -1872,8 +1844,9 @@ std::vector CreateTestScenarios(bool test_secure, GPR_ASSERT(!credentials_types.empty()); messages.push_back("Hello"); - if (test_big_message) { - for (size_t k = 1; k < MAX_TEST_MESSAGE_SIZE / 1024; k *= 32) { + if (test_message_size_limit) { + for (size_t k = 1; k < GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH / 1024; + k *= 32) { grpc::string big_msg; for (size_t i = 0; i < k * 1024; ++i) { char c = 'a' + (i % 26); @@ -1881,7 +1854,8 @@ std::vector CreateTestScenarios(bool test_secure, } messages.push_back(big_msg); } - messages.push_back(grpc::string(MAX_TEST_MESSAGE_SIZE - 10, 'a')); + messages.push_back( + grpc::string(GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH - 10, 'a')); } // TODO (sreek) Renable tests with health check service after the issue