diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/core/end2end/tests/streaming_error_response.c | 25 | ||||
-rw-r--r-- | test/core/transport/bdp_estimator_test.c | 7 |
2 files changed, 17 insertions, 15 deletions
diff --git a/test/core/end2end/tests/streaming_error_response.c b/test/core/end2end/tests/streaming_error_response.c index fd8fa7ff6c..9d562b9090 100644 --- a/test/core/end2end/tests/streaming_error_response.c +++ b/test/core/end2end/tests/streaming_error_response.c @@ -185,6 +185,19 @@ static void test(grpc_end2end_test_config config, bool request_status_early) { CQ_EXPECT_COMPLETION(cqv, tag(103), 1); cq_verify(cqv); + if (!request_status_early) { + memset(ops, 0, sizeof(ops)); + op = ops; + op->op = GRPC_OP_RECV_MESSAGE; + op->data.recv_message.recv_message = &response_payload2_recv; + op++; + error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); + + CQ_EXPECT_COMPLETION(cqv, tag(2), 1); + cq_verify(cqv); + } + memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; @@ -199,21 +212,9 @@ static void test(grpc_end2end_test_config config, bool request_status_early) { error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(104), NULL); GPR_ASSERT(GRPC_CALL_OK == error); - if (!request_status_early) { - memset(ops, 0, sizeof(ops)); - op = ops; - op->op = GRPC_OP_RECV_MESSAGE; - op->data.recv_message.recv_message = &response_payload2_recv; - op++; - error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(2), NULL); - GPR_ASSERT(GRPC_CALL_OK == error); - } - CQ_EXPECT_COMPLETION(cqv, tag(104), 1); if (request_status_early) { CQ_EXPECT_COMPLETION(cqv, tag(1), 1); - } else { - CQ_EXPECT_COMPLETION(cqv, tag(2), 1); } cq_verify(cqv); diff --git a/test/core/transport/bdp_estimator_test.c b/test/core/transport/bdp_estimator_test.c index e2612c7718..dda48f45b1 100644 --- a/test/core/transport/bdp_estimator_test.c +++ b/test/core/transport/bdp_estimator_test.c @@ -43,12 +43,13 @@ static void test_get_estimate_no_samples(void) { static void add_samples(grpc_bdp_estimator *estimator, int64_t *samples, size_t n) { - GPR_ASSERT(grpc_bdp_estimator_add_incoming_bytes(estimator, 1234567) == true); + grpc_bdp_estimator_add_incoming_bytes(estimator, 1234567); + GPR_ASSERT(grpc_bdp_estimator_need_ping(estimator) == true); grpc_bdp_estimator_schedule_ping(estimator); grpc_bdp_estimator_start_ping(estimator); for (size_t i = 0; i < n; i++) { - GPR_ASSERT(grpc_bdp_estimator_add_incoming_bytes(estimator, samples[i]) == - false); + grpc_bdp_estimator_add_incoming_bytes(estimator, samples[i]); + GPR_ASSERT(grpc_bdp_estimator_need_ping(estimator) == false); } gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_millis(1, GPR_TIMESPAN))); |