Fix bad_client_window_overflow_test at mac

pull/12729/head
yang-g 7 years ago
parent 708163a0b4
commit 6bf3184127
  1. 11
      test/core/bad_client/bad_client.c
  2. 1
      test/core/bad_client/bad_client.h
  3. 3
      test/core/bad_client/tests/window_overflow.c

@ -134,9 +134,12 @@ void grpc_run_bad_client_test(
grpc_endpoint_write(&exec_ctx, sfd.client, &outgoing, &done_write_closure);
grpc_exec_ctx_finish(&exec_ctx);
/* Await completion */
GPR_ASSERT(
gpr_event_wait(&a.done_write, grpc_timeout_seconds_to_deadline(5)));
/* Await completion, unless the request is large and write may not finish
* before the peer shuts down. */
if (!(flags & GRPC_BAD_CLIENT_LARGE_REQUEST)) {
GPR_ASSERT(
gpr_event_wait(&a.done_write, grpc_timeout_seconds_to_deadline(5)));
}
if (flags & GRPC_BAD_CLIENT_DISCONNECT) {
grpc_endpoint_shutdown(
@ -186,6 +189,8 @@ void grpc_run_bad_client_test(
grpc_exec_ctx_finish(&exec_ctx);
}
GPR_ASSERT(
gpr_event_wait(&a.done_write, grpc_timeout_seconds_to_deadline(1)));
shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
grpc_server_shutdown_and_notify(a.server, shutdown_cq, NULL);
GPR_ASSERT(grpc_completion_queue_pluck(

@ -37,6 +37,7 @@ typedef bool (*grpc_bad_client_client_stream_validator)(
grpc_slice_buffer *incoming);
#define GRPC_BAD_CLIENT_DISCONNECT 1
#define GRPC_BAD_CLIENT_LARGE_REQUEST 2
/* Test runner.

@ -90,7 +90,8 @@ int main(int argc, char **argv) {
addbuf(message, sizeof(message));
}
}
grpc_run_bad_client_test(verifier, NULL, g_buffer, g_count, 0);
grpc_run_bad_client_test(verifier, NULL, g_buffer, g_count,
GRPC_BAD_CLIENT_LARGE_REQUEST);
gpr_free(g_buffer);
return 0;

Loading…
Cancel
Save