diff options
author | David Garcia Quintas <dgq@google.com> | 2017-12-06 16:45:49 -0800 |
---|---|---|
committer | David Garcia Quintas <dgq@google.com> | 2017-12-06 16:45:49 -0800 |
commit | 4d9f7f6cf9600e09d5d6aad920d94204a3a3ef6a (patch) | |
tree | d506fdbc170ea53a3e1eee5c6d18c98141add29f /test/cpp/end2end | |
parent | d5ca876b6de1588a4387a2ef84740d8bae79cfbe (diff) |
PR comments
Diffstat (limited to 'test/cpp/end2end')
-rw-r--r-- | test/cpp/end2end/client_lb_end2end_test.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/cpp/end2end/client_lb_end2end_test.cc b/test/cpp/end2end/client_lb_end2end_test.cc index c09a324bf1..c25f65d37a 100644 --- a/test/cpp/end2end/client_lb_end2end_test.cc +++ b/test/cpp/end2end/client_lb_end2end_test.cc @@ -588,13 +588,13 @@ TEST_F(ClientLbEnd2endTest, RoundRobinReresolve) { gpr_log(GPR_INFO, "****** SERVERS RESTARTED *******"); gpr_log(GPR_INFO, "****** SENDING REQUEST TO SUCCEED *******"); // Client request should eventually (but still fairly soon) succeed. - bool call_succeeded = false; - for (gpr_timespec deadline = grpc_timeout_seconds_to_deadline(5); - gpr_time_cmp(deadline, gpr_now(GPR_CLOCK_MONOTONIC)) > 0;) { - call_succeeded = SendRpc().ok(); - if (call_succeeded) break; + const gpr_timespec deadline = grpc_timeout_seconds_to_deadline(5); + gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC); + while (gpr_time_cmp(deadline, now) > 0) { + if (SendRpc().ok()) break; + now = gpr_now(GPR_CLOCK_MONOTONIC); } - GPR_ASSERT(call_succeeded); + GPR_ASSERT(gpr_time_cmp(deadline, now) > 0); } } // namespace |