aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/end2end
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-02-05 21:41:23 -0800
committerGravatar Craig Tiller <craig.tiller@gmail.com>2015-02-05 21:41:23 -0800
commit8b976d0c244e516c2195c699bf396cf1dac2baa5 (patch)
treef6e3a69f2fb200cb3d036844cf691eebbd7eb36f /test/core/end2end
parentc230a7451dbfc0627bdd3173118a91b075856619 (diff)
Fixes
Diffstat (limited to 'test/core/end2end')
-rw-r--r--test/core/end2end/tests/cancel_after_accept.c25
-rw-r--r--test/core/end2end/tests/cancel_after_invoke.c2
2 files changed, 13 insertions, 14 deletions
diff --git a/test/core/end2end/tests/cancel_after_accept.c b/test/core/end2end/tests/cancel_after_accept.c
index 7e13021dc8..eb26ff14f0 100644
--- a/test/core/end2end/tests/cancel_after_accept.c
+++ b/test/core/end2end/tests/cancel_after_accept.c
@@ -105,8 +105,7 @@ static void end_test(grpc_end2end_test_fixture *f) {
/* Cancel after accept, no payload */
static void test_cancel_after_accept(grpc_end2end_test_config config,
- cancellation_mode mode, int client_ops,
- int server_ops) {
+ cancellation_mode mode) {
grpc_op ops[6];
grpc_op *op;
grpc_call *c;
@@ -162,7 +161,7 @@ static void test_cancel_after_accept(grpc_end2end_test_config config,
op->op = GRPC_OP_RECV_MESSAGE;
op->data.recv_message = &response_payload_recv;
op++;
- GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, client_ops, tag(1)));
+ GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1)));
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(f.server, &s,
&call_details,
@@ -172,6 +171,9 @@ static void test_cancel_after_accept(grpc_end2end_test_config config,
cq_verify(v_server);
op = ops;
+ op->op = GRPC_OP_RECV_MESSAGE;
+ op->data.recv_message = &request_payload_recv;
+ op++;
op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
op->data.recv_close_on_server.cancelled = &was_cancelled;
op++;
@@ -181,10 +183,7 @@ 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_MESSAGE;
- op->data.recv_message = &request_payload_recv;
- op++;
- GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, server_ops, tag(3)));
+ GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(3)));
GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c));
@@ -204,24 +203,24 @@ static void test_cancel_after_accept(grpc_end2end_test_config config,
grpc_call_details_destroy(&call_details);
grpc_byte_buffer_destroy(request_payload);
+ grpc_byte_buffer_destroy(response_payload);
+ grpc_byte_buffer_destroy(request_payload_recv);
grpc_byte_buffer_destroy(response_payload_recv);
gpr_free(details);
grpc_call_destroy(c);
+ grpc_call_destroy(s);
cq_verifier_destroy(v_client);
+ cq_verifier_destroy(v_server);
end_test(&f);
config.tear_down_data(&f);
}
void grpc_end2end_tests(grpc_end2end_test_config config) {
- unsigned i, j, k;
+ unsigned i;
for (i = 0; i < GPR_ARRAY_SIZE(cancellation_modes); i++) {
- for (j = 2; j <= 6; j++) {
- for (k = 1; k <= 4; k++) {
- test_cancel_after_accept(config, cancellation_modes[i], j, k);
- }
- }
+ test_cancel_after_accept(config, cancellation_modes[i]);
}
}
diff --git a/test/core/end2end/tests/cancel_after_invoke.c b/test/core/end2end/tests/cancel_after_invoke.c
index ace10f172d..96a8186d15 100644
--- a/test/core/end2end/tests/cancel_after_invoke.c
+++ b/test/core/end2end/tests/cancel_after_invoke.c
@@ -183,7 +183,7 @@ static void test_cancel_after_invoke(grpc_end2end_test_config config,
void grpc_end2end_tests(grpc_end2end_test_config config) {
unsigned i, j;
- for (j = 1; j < 6; j++) {
+ for (j = 2; j < 6; j++) {
for (i = 0; i < GPR_ARRAY_SIZE(cancellation_modes); i++) {
test_cancel_after_invoke(config, cancellation_modes[i], j);
}