Merge pull request #16259 from AspirinSJL/filter_bug

Add cpp test for large RPC
pull/16263/head
Juanli Shen 7 years ago committed by GitHub
commit 6499836bda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 23
      test/cpp/end2end/async_end2end_test.cc

@ -1709,7 +1709,7 @@ TEST_P(AsyncEnd2endServerTryCancelTest, ServerBidiStreamingTryCancelAfter) {
} }
std::vector<TestScenario> CreateTestScenarios(bool test_secure, std::vector<TestScenario> CreateTestScenarios(bool test_secure,
int test_big_limit) { bool test_message_size_limit) {
std::vector<TestScenario> scenarios; std::vector<TestScenario> scenarios;
std::vector<grpc::string> credentials_types; std::vector<grpc::string> credentials_types;
std::vector<grpc::string> messages; std::vector<grpc::string> messages;
@ -1731,13 +1731,18 @@ std::vector<TestScenario> CreateTestScenarios(bool test_secure,
GPR_ASSERT(!credentials_types.empty()); GPR_ASSERT(!credentials_types.empty());
messages.push_back("Hello"); messages.push_back("Hello");
for (int sz = 1; sz <= test_big_limit; sz *= 32) { if (test_message_size_limit) {
grpc::string big_msg; for (size_t k = 1; k < GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH / 1024;
for (int i = 0; i < sz * 1024; i++) { k *= 32) {
char c = 'a' + (i % 26); grpc::string big_msg;
big_msg += c; for (size_t i = 0; i < k * 1024; ++i) {
char c = 'a' + (i % 26);
big_msg += c;
}
messages.push_back(big_msg);
} }
messages.push_back(big_msg); messages.push_back(
grpc::string(GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH - 10, 'a'));
} }
// TODO (sreek) Renable tests with health check service after the issue // TODO (sreek) Renable tests with health check service after the issue
@ -1758,10 +1763,10 @@ std::vector<TestScenario> CreateTestScenarios(bool test_secure,
} }
INSTANTIATE_TEST_CASE_P(AsyncEnd2end, AsyncEnd2endTest, INSTANTIATE_TEST_CASE_P(AsyncEnd2end, AsyncEnd2endTest,
::testing::ValuesIn(CreateTestScenarios(true, 1024))); ::testing::ValuesIn(CreateTestScenarios(true, true)));
INSTANTIATE_TEST_CASE_P(AsyncEnd2endServerTryCancel, INSTANTIATE_TEST_CASE_P(AsyncEnd2endServerTryCancel,
AsyncEnd2endServerTryCancelTest, AsyncEnd2endServerTryCancelTest,
::testing::ValuesIn(CreateTestScenarios(false, 0))); ::testing::ValuesIn(CreateTestScenarios(false, false)));
} // namespace } // namespace
} // namespace testing } // namespace testing

Loading…
Cancel
Save