diff options
author | 2015-11-18 07:08:36 -0800 | |
---|---|---|
committer | 2015-11-18 07:08:36 -0800 | |
commit | e24913b35b804287d4900de73358d6cd5666acec (patch) | |
tree | aca70378b0f68ce97bd401dc418b4fcd2bad32b4 /test | |
parent | 6b80d4913b5d2a4ebbfd176a11c66a4726a42381 (diff) | |
parent | 47b48459f3802af8aa7d5e4cbe2d4fda5cd16449 (diff) |
Merge branch 'new_op' of github.com:ctiller/grpc into new_op
Diffstat (limited to 'test')
-rw-r--r-- | test/core/client_config/lb_policies_test.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/test/core/client_config/lb_policies_test.c b/test/core/client_config/lb_policies_test.c index e44930ed53..0218b8f07f 100644 --- a/test/core/client_config/lb_policies_test.c +++ b/test/core/client_config/lb_policies_test.c @@ -303,7 +303,8 @@ int *perform_request(servers_fixture *f, grpc_channel *client, grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL)); s_idx = -1; - while ((ev = grpc_completion_queue_next(f->cq, n_millis_time(s_idx == -1 ? 3000 : 200), NULL)) + while ((ev = grpc_completion_queue_next( + f->cq, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1), NULL)) .type != GRPC_QUEUE_TIMEOUT) { GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); read_tag = ((int)(gpr_intptr)ev.tag); @@ -315,6 +316,7 @@ int *perform_request(servers_fixture *f, grpc_channel *client, s_idx = read_tag - 1000; s_valid[s_idx] = 1; connection_sequence[iter_num] = s_idx; + break; } else if (read_tag == 1) { gpr_log(GPR_DEBUG, "client timed out"); GPR_ASSERT(ev.success); @@ -453,6 +455,8 @@ void run_spec(const test_spec *spec) { int *actual_connection_sequence; request_data rdata; servers_fixture *f; + grpc_channel_args args; + grpc_arg arg; rdata.call_details = gpr_malloc(sizeof(grpc_call_details) * spec->num_servers); f = setup_servers("127.0.0.1", &rdata, spec->num_servers); @@ -462,7 +466,14 @@ void run_spec(const test_spec *spec) { f->num_servers, ",", NULL); gpr_asprintf(&client_hostport, "ipv4:%s?lb_policy=round_robin", servers_hostports_str); - client = grpc_insecure_channel_create(client_hostport, NULL, NULL); + + arg.type = GRPC_ARG_INTEGER; + arg.key = "grpc.testing.fixed_reconnect_backoff"; + arg.value.integer = 100; + args.num_args = 1; + args.args = &arg; + + client = grpc_insecure_channel_create(client_hostport, &args, NULL); gpr_log(GPR_INFO, "Testing '%s' with servers=%s client=%s", spec->description, servers_hostports_str, client_hostport); |