diff options
author | Craig Tiller <ctiller@google.com> | 2015-04-30 13:29:48 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-04-30 13:29:48 -0700 |
commit | f1071209077dd800d4dbf7539930a9f7acde7a3e (patch) | |
tree | e7bd17043ba3dc5f19a5e9f4efd06707257a153d /test/core/end2end | |
parent | 48373dfab0422f9f07dc0a6a7b9ff8c73ec4b3e3 (diff) |
Fixing some tests I broke during conversion
Diffstat (limited to 'test/core/end2end')
7 files changed, 30 insertions, 22 deletions
diff --git a/test/core/end2end/dualstack_socket_test.c b/test/core/end2end/dualstack_socket_test.c index f0b62ec71b..5e278ca66c 100644 --- a/test/core/end2end/dualstack_socket_test.c +++ b/test/core/end2end/dualstack_socket_test.c @@ -186,7 +186,7 @@ void test_connect(const char *server_host, const char *client_host, int port, GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED); GPR_ASSERT(0 == strcmp(details, "xyz")); GPR_ASSERT(0 == strcmp(call_details.method, "/foo")); - GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr:1234")); + GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr")); GPR_ASSERT(was_cancelled == 0); grpc_call_destroy(s); diff --git a/test/core/end2end/tests/cancel_after_accept.c b/test/core/end2end/tests/cancel_after_accept.c index 1d7bdf8ab2..21057969d9 100644 --- a/test/core/end2end/tests/cancel_after_accept.c +++ b/test/core/end2end/tests/cancel_after_accept.c @@ -177,6 +177,9 @@ static void test_cancel_after_accept(grpc_end2end_test_config config, op->op = GRPC_OP_SEND_MESSAGE; op->data.send_message = response_payload; op++; + op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; + op->data.recv_close_on_server.cancelled = &was_cancelled; + op++; GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(3))); GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c)); diff --git a/test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c b/test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c index 3c78788d92..2c2d2e895b 100644 --- a/test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c +++ b/test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c @@ -155,6 +155,12 @@ static void test_early_server_shutdown_finishes_inflight_calls( cq_expect_completion(v_server, tag(101), GRPC_OP_OK); cq_verify(v_server); + op = ops; + op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; + op->data.recv_close_on_server.cancelled = &was_cancelled; + op++; + GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102))); + /* shutdown and destroy the server */ shutdown_server(&f); diff --git a/test/core/end2end/tests/early_server_shutdown_finishes_tags.c b/test/core/end2end/tests/early_server_shutdown_finishes_tags.c index 172724b760..96978a8cb9 100644 --- a/test/core/end2end/tests/early_server_shutdown_finishes_tags.c +++ b/test/core/end2end/tests/early_server_shutdown_finishes_tags.c @@ -120,7 +120,7 @@ static void test_early_server_shutdown_finishes_tags( &request_metadata_recv, f.server_cq, tag(101))); grpc_server_shutdown(f.server); - cq_expect_completion(v_server, tag(101), GRPC_OP_OK); + cq_expect_completion(v_server, tag(101), GRPC_OP_ERROR); cq_verify(v_server); GPR_ASSERT(s == NULL); diff --git a/test/core/end2end/tests/graceful_server_shutdown.c b/test/core/end2end/tests/graceful_server_shutdown.c index 50aa29d27a..d084530a9c 100644 --- a/test/core/end2end/tests/graceful_server_shutdown.c +++ b/test/core/end2end/tests/graceful_server_shutdown.c @@ -173,16 +173,19 @@ static void test_early_server_shutdown_finishes_inflight_calls( GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102))); cq_expect_completion(v_server, tag(102), GRPC_OP_OK); + cq_verify(v_server); + + grpc_call_destroy(s); cq_expect_server_shutdown(v_server, tag(0xdead)); cq_verify(v_server); cq_expect_completion(v_client, tag(1), GRPC_OP_OK); cq_verify(v_client); - GPR_ASSERT(status == GRPC_STATUS_UNAVAILABLE); + GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED); GPR_ASSERT(0 == strcmp(call_details.method, "/foo")); GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr")); - GPR_ASSERT(was_cancelled == 1); + GPR_ASSERT(was_cancelled == 0); gpr_free(details); grpc_metadata_array_destroy(&initial_metadata_recv); @@ -191,7 +194,6 @@ static void test_early_server_shutdown_finishes_inflight_calls( grpc_call_details_destroy(&call_details); grpc_call_destroy(c); - grpc_call_destroy(s); cq_verifier_destroy(v_client); cq_verifier_destroy(v_server); diff --git a/test/core/end2end/tests/max_concurrent_streams.c b/test/core/end2end/tests/max_concurrent_streams.c index 58c82cb2cb..2bff3c9dfb 100644 --- a/test/core/end2end/tests/max_concurrent_streams.c +++ b/test/core/end2end/tests/max_concurrent_streams.c @@ -232,6 +232,11 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { v_server = cq_verifier_create(f.server_cq); grpc_metadata_array_init(&request_metadata_recv); + grpc_metadata_array_init(&initial_metadata_recv1); + grpc_metadata_array_init(&trailing_metadata_recv1); + grpc_metadata_array_init(&initial_metadata_recv2); + grpc_metadata_array_init(&trailing_metadata_recv2); + grpc_call_details_init(&call_details); /* perform a ping-pong to ensure that settings have had a chance to round trip */ @@ -241,7 +246,7 @@ 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(); + deadline = n_seconds_time(10); c1 = grpc_channel_create_call(f.client, f.client_cq, "/alpha", "foo.test.google.fr:1234", deadline); GPR_ASSERT(c1); @@ -298,8 +303,8 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c2, ops, op - ops, tag(402))); - ev = grpc_completion_queue_next( - f.client_cq, gpr_time_add(gpr_now(), gpr_time_from_seconds(10))); + ev = grpc_completion_queue_next(f.client_cq, + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3)); GPR_ASSERT(ev); GPR_ASSERT(ev->type == GRPC_OP_COMPLETE); GPR_ASSERT(ev->data.op_complete == GRPC_OP_OK); @@ -310,7 +315,7 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { live_call = ((int)(gpr_intptr)ev->tag) - 1; grpc_event_finish(ev); - cq_expect_completion(v_server, tag(100), GRPC_OP_OK); + cq_expect_completion(v_server, tag(101), GRPC_OP_OK); cq_verify(v_server); op = ops; @@ -323,7 +328,7 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s1, ops, op - ops, tag(102))); - cq_expect_completion(v_client, tag(live_call + 1), GRPC_OP_OK); + cq_expect_completion(v_client, tag(live_call + 2), GRPC_OP_OK); cq_verify(v_client); op = ops; @@ -335,13 +340,13 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s1, ops, op - ops, tag(103))); + cq_expect_completion(v_server, tag(102), GRPC_OP_OK); cq_expect_completion(v_server, tag(103), GRPC_OP_OK); cq_verify(v_server); /* first request is finished, we should be able to start the second */ - cq_expect_completion(v_client, tag(live_call + 2), GRPC_OP_OK); live_call = (live_call == 300) ? 400 : 300; - cq_expect_completion(v_client, tag(live_call + 3), GRPC_OP_OK); + cq_expect_completion(v_client, tag(live_call + 1), GRPC_OP_OK); cq_verify(v_client); GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(f.server, &s2, @@ -361,7 +366,7 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s2, ops, op - ops, tag(202))); - cq_expect_completion(v_client, tag(live_call + 1), GRPC_OP_OK); + cq_expect_completion(v_client, tag(live_call + 2), GRPC_OP_OK); cq_verify(v_client); op = ops; @@ -373,12 +378,10 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s2, ops, op - ops, tag(203))); + cq_expect_completion(v_server, tag(202), GRPC_OP_OK); cq_expect_completion(v_server, tag(203), GRPC_OP_OK); cq_verify(v_server); - cq_expect_completion(v_client, tag(live_call + 2), GRPC_OP_OK); - cq_verify(v_client); - cq_verifier_destroy(v_client); cq_verifier_destroy(v_server); diff --git a/test/core/end2end/tests/ping_pong_streaming.c b/test/core/end2end/tests/ping_pong_streaming.c index 1efe7a13ed..a40e9ec168 100644 --- a/test/core/end2end/tests/ping_pong_streaming.c +++ b/test/core/end2end/tests/ping_pong_streaming.c @@ -218,9 +218,6 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(3))); op = ops; - op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; - op->data.recv_close_on_server.cancelled = &was_cancelled; - op++; op->op = GRPC_OP_SEND_STATUS_FROM_SERVER; op->data.send_status_from_server.trailing_metadata_count = 0; op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED; @@ -239,9 +236,6 @@ static void test_pingpong_streaming(grpc_end2end_test_config config, grpc_call_destroy(c); grpc_call_destroy(s); - end_test(&f); - config.tear_down_data(&f); - cq_verifier_destroy(v_client); cq_verifier_destroy(v_server); |