|
|
|
@ -109,27 +109,29 @@ static void simple_request_body(grpc_end2end_test_fixture f) { |
|
|
|
|
cq_verifier *v_client = cq_verifier_create(f.client_cq); |
|
|
|
|
cq_verifier *v_server = cq_verifier_create(f.server_cq); |
|
|
|
|
|
|
|
|
|
c = grpc_channel_create_call(f.client, "/foo", "test.google.com", deadline); |
|
|
|
|
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com", |
|
|
|
|
deadline); |
|
|
|
|
GPR_ASSERT(c); |
|
|
|
|
|
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == |
|
|
|
|
grpc_call_invoke(c, f.client_cq, tag(2), tag(3), 0)); |
|
|
|
|
grpc_call_invoke_old(c, f.client_cq, tag(2), tag(3), 0)); |
|
|
|
|
|
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == grpc_call_writes_done(c, tag(4))); |
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == grpc_call_writes_done_old(c, tag(4))); |
|
|
|
|
cq_expect_finish_accepted(v_client, tag(4), GRPC_OP_OK); |
|
|
|
|
cq_verify(v_client); |
|
|
|
|
|
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(f.server, tag(100))); |
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f.server, tag(100))); |
|
|
|
|
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com", |
|
|
|
|
deadline, NULL); |
|
|
|
|
cq_verify(v_server); |
|
|
|
|
|
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_accept(s, f.server_cq, tag(102))); |
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0)); |
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == |
|
|
|
|
grpc_call_server_accept_old(s, f.server_cq, tag(102))); |
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata_old(s, 0)); |
|
|
|
|
cq_expect_client_metadata_read(v_client, tag(2), NULL); |
|
|
|
|
cq_verify(v_client); |
|
|
|
|
|
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_write_status( |
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_write_status_old( |
|
|
|
|
s, GRPC_STATUS_UNIMPLEMENTED, "xyz", tag(5))); |
|
|
|
|
cq_expect_finished_with_status(v_client, tag(3), GRPC_STATUS_UNIMPLEMENTED, |
|
|
|
|
"xyz", NULL); |
|
|
|
@ -181,20 +183,21 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { |
|
|
|
|
/* start two requests - ensuring that the second is not accepted until
|
|
|
|
|
the first completes */ |
|
|
|
|
deadline = five_seconds_time(); |
|
|
|
|
c1 = |
|
|
|
|
grpc_channel_create_call(f.client, "/alpha", "test.google.com", deadline); |
|
|
|
|
c1 = grpc_channel_create_call_old(f.client, "/alpha", "test.google.com", |
|
|
|
|
deadline); |
|
|
|
|
GPR_ASSERT(c1); |
|
|
|
|
c2 = grpc_channel_create_call(f.client, "/beta", "test.google.com", deadline); |
|
|
|
|
c2 = grpc_channel_create_call_old(f.client, "/beta", "test.google.com", |
|
|
|
|
deadline); |
|
|
|
|
GPR_ASSERT(c1); |
|
|
|
|
|
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(f.server, tag(100))); |
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f.server, tag(100))); |
|
|
|
|
|
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == |
|
|
|
|
grpc_call_invoke(c1, f.client_cq, tag(301), tag(302), 0)); |
|
|
|
|
grpc_call_invoke_old(c1, f.client_cq, tag(301), tag(302), 0)); |
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == |
|
|
|
|
grpc_call_invoke(c2, f.client_cq, tag(401), tag(402), 0)); |
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == grpc_call_writes_done(c1, tag(303))); |
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == grpc_call_writes_done(c2, tag(303))); |
|
|
|
|
grpc_call_invoke_old(c2, f.client_cq, tag(401), tag(402), 0)); |
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == grpc_call_writes_done_old(c1, tag(303))); |
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == grpc_call_writes_done_old(c2, tag(303))); |
|
|
|
|
|
|
|
|
|
ev = grpc_completion_queue_next( |
|
|
|
|
f.client_cq, gpr_time_add(gpr_now(), gpr_time_from_seconds(10))); |
|
|
|
@ -213,14 +216,14 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { |
|
|
|
|
cq_verify(v_server); |
|
|
|
|
|
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == |
|
|
|
|
grpc_call_server_accept(s1, f.server_cq, tag(102))); |
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s1, 0)); |
|
|
|
|
grpc_call_server_accept_old(s1, f.server_cq, tag(102))); |
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata_old(s1, 0)); |
|
|
|
|
cq_expect_client_metadata_read(v_client, tag(live_call + 1), NULL); |
|
|
|
|
cq_verify(v_client); |
|
|
|
|
|
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == |
|
|
|
|
grpc_call_start_write_status(s1, GRPC_STATUS_UNIMPLEMENTED, "xyz", |
|
|
|
|
tag(103))); |
|
|
|
|
grpc_call_start_write_status_old(s1, GRPC_STATUS_UNIMPLEMENTED, |
|
|
|
|
"xyz", tag(103))); |
|
|
|
|
cq_expect_finish_accepted(v_server, tag(103), GRPC_OP_OK); |
|
|
|
|
cq_expect_finished(v_server, tag(102), NULL); |
|
|
|
|
cq_verify(v_server); |
|
|
|
@ -232,21 +235,21 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { |
|
|
|
|
live_call = (live_call == 300) ? 400 : 300; |
|
|
|
|
cq_verify(v_client); |
|
|
|
|
|
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(f.server, tag(200))); |
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f.server, tag(200))); |
|
|
|
|
cq_expect_server_rpc_new(v_server, &s2, tag(200), |
|
|
|
|
live_call == 300 ? "/alpha" : "/beta", |
|
|
|
|
"test.google.com", deadline, NULL); |
|
|
|
|
cq_verify(v_server); |
|
|
|
|
|
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == |
|
|
|
|
grpc_call_server_accept(s2, f.server_cq, tag(202))); |
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s2, 0)); |
|
|
|
|
grpc_call_server_accept_old(s2, f.server_cq, tag(202))); |
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata_old(s2, 0)); |
|
|
|
|
cq_expect_client_metadata_read(v_client, tag(live_call + 1), NULL); |
|
|
|
|
cq_verify(v_client); |
|
|
|
|
|
|
|
|
|
GPR_ASSERT(GRPC_CALL_OK == |
|
|
|
|
grpc_call_start_write_status(s2, GRPC_STATUS_UNIMPLEMENTED, "xyz", |
|
|
|
|
tag(203))); |
|
|
|
|
grpc_call_start_write_status_old(s2, GRPC_STATUS_UNIMPLEMENTED, |
|
|
|
|
"xyz", tag(203))); |
|
|
|
|
cq_expect_finish_accepted(v_server, tag(203), GRPC_OP_OK); |
|
|
|
|
cq_expect_finished(v_server, tag(202), NULL); |
|
|
|
|
cq_verify(v_server); |
|
|
|
|