pull/5854/head
Craig Tiller 9 years ago
parent 33599977b3
commit 132a00623b
  1. 25
      test/core/client_config/lb_policies_test.c

@ -1,6 +1,6 @@
/* /*
* *
* Copyright 2015, Google Inc. * Copyright 2015-2016, Google Inc.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -139,9 +139,8 @@ static void kill_server(const servers_fixture *f, size_t i) {
gpr_log(GPR_INFO, "KILLING SERVER %d", i); gpr_log(GPR_INFO, "KILLING SERVER %d", i);
GPR_ASSERT(f->servers[i] != NULL); GPR_ASSERT(f->servers[i] != NULL);
grpc_server_shutdown_and_notify(f->servers[i], f->cq, tag(10000)); grpc_server_shutdown_and_notify(f->servers[i], f->cq, tag(10000));
GPR_ASSERT( GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(10000), n_millis_time(5000),
grpc_completion_queue_pluck(f->cq, tag(10000), n_millis_time(5000), NULL) NULL).type == GRPC_OP_COMPLETE);
.type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->servers[i]); grpc_server_destroy(f->servers[i]);
f->servers[i] = NULL; f->servers[i] = NULL;
} }
@ -207,8 +206,8 @@ static void teardown_servers(servers_fixture *f) {
if (f->servers[i] == NULL) continue; if (f->servers[i] == NULL) continue;
grpc_server_shutdown_and_notify(f->servers[i], f->cq, tag(10000)); grpc_server_shutdown_and_notify(f->servers[i], f->cq, tag(10000));
GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(10000), GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(10000),
n_millis_time(5000), NULL) n_millis_time(5000),
.type == GRPC_OP_COMPLETE); NULL).type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->servers[i]); grpc_server_destroy(f->servers[i]);
} }
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
@ -305,10 +304,9 @@ static int *perform_request(servers_fixture *f, grpc_channel *client,
grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL)); grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL));
s_idx = -1; s_idx = -1;
while ( while ((ev = grpc_completion_queue_next(
(ev = grpc_completion_queue_next( f->cq, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(10 * RETRY_TIMEOUT),
f->cq, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(10 * RETRY_TIMEOUT), NULL)) NULL)).type != GRPC_QUEUE_TIMEOUT) {
.type != GRPC_QUEUE_TIMEOUT) {
GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
read_tag = ((int)(intptr_t)ev.tag); read_tag = ((int)(intptr_t)ev.tag);
gpr_log(GPR_DEBUG, "EVENT: success:%d, type:%d, tag:%d iter:%d", gpr_log(GPR_DEBUG, "EVENT: success:%d, type:%d, tag:%d iter:%d",
@ -380,10 +378,9 @@ static int *perform_request(servers_fixture *f, grpc_channel *client,
} }
} }
GPR_ASSERT( GPR_ASSERT(grpc_completion_queue_next(
grpc_completion_queue_next( f->cq, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(2 * RETRY_TIMEOUT),
f->cq, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(2 * RETRY_TIMEOUT), NULL) NULL).type == GRPC_QUEUE_TIMEOUT);
.type == GRPC_QUEUE_TIMEOUT);
grpc_metadata_array_destroy(&rdata->initial_metadata_recv); grpc_metadata_array_destroy(&rdata->initial_metadata_recv);
grpc_metadata_array_destroy(&rdata->trailing_metadata_recv); grpc_metadata_array_destroy(&rdata->trailing_metadata_recv);

Loading…
Cancel
Save