diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2017-05-26 00:31:18 +0200 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2017-05-26 00:31:18 +0200 |
commit | 5a1d197f1ced4ed9f64a3816ac48e89d4c7687f6 (patch) | |
tree | f16f3aa8f064c366db409ed9c879aba4d250693b /test/core/end2end | |
parent | 670d8bf67512998437b8bb87c393c764774294ed (diff) | |
parent | 0bd14cc89df05b04d0cd7b526c921eb60de4cf63 (diff) |
Merge branch 'master' of https://github.com/grpc/grpc into import
Diffstat (limited to 'test/core/end2end')
-rw-r--r-- | test/core/end2end/cq_verifier.c | 8 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_full+workarounds.c | 3 | ||||
-rw-r--r-- | test/core/end2end/fixtures/http_proxy_fixture.c | 19 |
3 files changed, 21 insertions, 9 deletions
diff --git a/test/core/end2end/cq_verifier.c b/test/core/end2end/cq_verifier.c index 0fafb0c8c9..5c54549674 100644 --- a/test/core/end2end/cq_verifier.c +++ b/test/core/end2end/cq_verifier.c @@ -189,10 +189,16 @@ int byte_buffer_eq_string(grpc_byte_buffer *bb, const char *str) { return res; } +static bool is_probably_integer(void *p) { return ((uintptr_t)p) < 1000000; } + static void expectation_to_strvec(gpr_strvec *buf, expectation *e) { char *tmp; - gpr_asprintf(&tmp, "%p ", e->tag); + if (is_probably_integer(e->tag)) { + gpr_asprintf(&tmp, "tag(%" PRIdPTR ") ", (intptr_t)e->tag); + } else { + gpr_asprintf(&tmp, "%p ", e->tag); + } gpr_strvec_add(buf, tmp); switch (e->type) { diff --git a/test/core/end2end/fixtures/h2_full+workarounds.c b/test/core/end2end/fixtures/h2_full+workarounds.c index 2e9264ffa6..fcb2024645 100644 --- a/test/core/end2end/fixtures/h2_full+workarounds.c +++ b/test/core/end2end/fixtures/h2_full+workarounds.c @@ -83,10 +83,11 @@ void chttp2_init_client_fullstack(grpc_end2end_test_fixture *f, void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f, grpc_channel_args *server_args) { + int i; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; fullstack_fixture_data *ffd = f->fixture_data; grpc_arg args[GRPC_MAX_WORKAROUND_ID]; - for (uint32_t i = 0; i < GRPC_MAX_WORKAROUND_ID; i++) { + for (i = 0; i < GRPC_MAX_WORKAROUND_ID; i++) { args[i].key = workarounds_arg[i]; args[i].type = GRPC_ARG_INTEGER; args[i].value.integer = 1; diff --git a/test/core/end2end/fixtures/http_proxy_fixture.c b/test/core/end2end/fixtures/http_proxy_fixture.c index c2d8480e69..b8a53ed113 100644 --- a/test/core/end2end/fixtures/http_proxy_fixture.c +++ b/test/core/end2end/fixtures/http_proxy_fixture.c @@ -50,6 +50,7 @@ #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/http/parser.h" #include "src/core/lib/iomgr/closure.h" +#include "src/core/lib/iomgr/combiner.h" #include "src/core/lib/iomgr/endpoint.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/exec_ctx.h" @@ -71,6 +72,8 @@ struct grpc_end2end_http_proxy { gpr_mu* mu; grpc_pollset* pollset; gpr_refcount users; + + grpc_combiner* combiner; }; // @@ -400,19 +403,19 @@ static void on_accept(grpc_exec_ctx* exec_ctx, void* arg, grpc_pollset_set_add_pollset(exec_ctx, conn->pollset_set, proxy->pollset); grpc_endpoint_add_to_pollset_set(exec_ctx, endpoint, conn->pollset_set); grpc_closure_init(&conn->on_read_request_done, on_read_request_done, conn, - grpc_schedule_on_exec_ctx); + grpc_combiner_scheduler(conn->proxy->combiner, false)); grpc_closure_init(&conn->on_server_connect_done, on_server_connect_done, conn, - grpc_schedule_on_exec_ctx); + grpc_combiner_scheduler(conn->proxy->combiner, false)); grpc_closure_init(&conn->on_write_response_done, on_write_response_done, conn, - grpc_schedule_on_exec_ctx); + grpc_combiner_scheduler(conn->proxy->combiner, false)); grpc_closure_init(&conn->on_client_read_done, on_client_read_done, conn, - grpc_schedule_on_exec_ctx); + grpc_combiner_scheduler(conn->proxy->combiner, false)); grpc_closure_init(&conn->on_client_write_done, on_client_write_done, conn, - grpc_schedule_on_exec_ctx); + grpc_combiner_scheduler(conn->proxy->combiner, false)); grpc_closure_init(&conn->on_server_read_done, on_server_read_done, conn, - grpc_schedule_on_exec_ctx); + grpc_combiner_scheduler(conn->proxy->combiner, false)); grpc_closure_init(&conn->on_server_write_done, on_server_write_done, conn, - grpc_schedule_on_exec_ctx); + grpc_combiner_scheduler(conn->proxy->combiner, false)); grpc_slice_buffer_init(&conn->client_read_buffer); grpc_slice_buffer_init(&conn->client_deferred_write_buffer); grpc_slice_buffer_init(&conn->client_write_buffer); @@ -453,6 +456,7 @@ grpc_end2end_http_proxy* grpc_end2end_http_proxy_create(void) { grpc_end2end_http_proxy* proxy = (grpc_end2end_http_proxy*)gpr_malloc(sizeof(*proxy)); memset(proxy, 0, sizeof(*proxy)); + proxy->combiner = grpc_combiner_create(NULL); gpr_ref_init(&proxy->users, 1); // Construct proxy address. const int proxy_port = grpc_pick_unused_port_or_die(); @@ -504,6 +508,7 @@ void grpc_end2end_http_proxy_destroy(grpc_end2end_http_proxy* proxy) { grpc_pollset_shutdown(&exec_ctx, proxy->pollset, grpc_closure_create(destroy_pollset, proxy->pollset, grpc_schedule_on_exec_ctx)); + grpc_combiner_unref(&exec_ctx, proxy->combiner); gpr_free(proxy); grpc_exec_ctx_finish(&exec_ctx); } |