diff options
author | David Garcia Quintas <dgq@google.com> | 2016-05-12 17:54:58 -0700 |
---|---|---|
committer | David Garcia Quintas <dgq@google.com> | 2016-05-12 17:54:58 -0700 |
commit | 48a5ddd00ca52e9c16a66981975ea60728bd7936 (patch) | |
tree | 16533ce67d1ff2fe7f81832a904c1c2a24a41181 /test/core/end2end/tests | |
parent | a301eaade83854cf172d39899232835f21e57690 (diff) | |
parent | f11f2b1b69aeceb3deb3be3e68a6e5fa759d194c (diff) |
Merge branch 'master' of github.com:grpc/grpc into compression_md_level_bis
Diffstat (limited to 'test/core/end2end/tests')
-rw-r--r-- | test/core/end2end/tests/large_metadata.c | 15 | ||||
-rw-r--r-- | test/core/end2end/tests/max_message_length.c | 5 |
2 files changed, 16 insertions, 4 deletions
diff --git a/test/core/end2end/tests/large_metadata.c b/test/core/end2end/tests/large_metadata.c index 6631d207d2..1f27896019 100644 --- a/test/core/end2end/tests/large_metadata.c +++ b/test/core/end2end/tests/large_metadata.c @@ -97,7 +97,7 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_destroy(f->cq); } -/* Request with a large amount of metadata.*/ +// Request with a large amount of metadata. static void test_request_with_large_metadata(grpc_end2end_test_config config) { grpc_call *c; grpc_call *s; @@ -106,8 +106,13 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) { grpc_raw_byte_buffer_create(&request_payload_slice, 1); gpr_timespec deadline = five_seconds_time(); grpc_metadata meta; + const size_t large_size = 64 * 1024; + grpc_arg arg = {GRPC_ARG_INTEGER, + GRPC_ARG_MAX_METADATA_SIZE, + {.integer = (int)large_size + 1024}}; + grpc_channel_args args = {1, &arg}; grpc_end2end_test_fixture f = - begin_test(config, "test_request_with_large_metadata", NULL, NULL); + begin_test(config, "test_request_with_large_metadata", &args, &args); cq_verifier *cqv = cq_verifier_create(f.cq); grpc_op ops[6]; grpc_op *op; @@ -121,7 +126,6 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) { char *details = NULL; size_t details_capacity = 0; int was_cancelled = 2; - const size_t large_size = 64 * 1024; c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, "/foo", "foo.test.google.fr", deadline, NULL); @@ -139,6 +143,7 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) { grpc_call_details_init(&call_details); memset(ops, 0, sizeof(ops)); + // Client: send request. op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 1; @@ -175,10 +180,12 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) { grpc_server_request_call(f.server, &s, &call_details, &request_metadata_recv, f.cq, f.cq, tag(101)); GPR_ASSERT(GRPC_CALL_OK == error); + cq_expect_completion(cqv, tag(101), 1); cq_verify(cqv); memset(ops, 0, sizeof(ops)); + // Server: send initial metadata and receive request. op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; @@ -197,6 +204,8 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) { cq_verify(cqv); memset(ops, 0, sizeof(ops)); + // Server: receive close and send status. This should trigger + // completion of request on client. op = ops; op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; op->data.recv_close_on_server.cancelled = &was_cancelled; diff --git a/test/core/end2end/tests/max_message_length.c b/test/core/end2end/tests/max_message_length.c index 6d957ef55d..08d326ab4d 100644 --- a/test/core/end2end/tests/max_message_length.c +++ b/test/core/end2end/tests/max_message_length.c @@ -53,7 +53,10 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, grpc_channel_args *server_args) { grpc_end2end_test_fixture f; gpr_log(GPR_INFO, "%s/%s", test_name, config.name); - f = config.create_fixture(client_args, server_args); + // We intentionally do not pass the client and server args to + // create_fixture(), since we don't want the limit enforced on the + // proxy, only on the backend server. + f = config.create_fixture(NULL, NULL); config.init_server(&f, server_args); config.init_client(&f, client_args); return f; |