diff options
author | Craig Tiller <ctiller@google.com> | 2015-07-06 10:43:50 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-07-06 10:43:50 -0700 |
commit | 20b5fe9282e54d00082a4512bcd5ceb0d650abdc (patch) | |
tree | 9b5f8f6a417313896f0a825ef553a9e53ea64bfe /test/cpp/end2end | |
parent | f3756c1e0d09a90173851a8e8ab4f6342ae8de45 (diff) |
Fixup C++
Diffstat (limited to 'test/cpp/end2end')
-rw-r--r-- | test/cpp/end2end/end2end_test.cc | 9 | ||||
-rw-r--r-- | test/cpp/end2end/server_crash_test.cc | 12 | ||||
-rw-r--r-- | test/cpp/end2end/thread_stress_test.cc | 4 |
3 files changed, 15 insertions, 10 deletions
diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index 5e850ea30a..8e669df4f3 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -100,15 +100,15 @@ class TestServiceImpl : public ::grpc::cpp::test::util::TestService::Service { } while (!context->IsCancelled()) { gpr_sleep_until(gpr_time_add( - gpr_now(), + gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_micros(request->param().client_cancel_after_us()))); } return Status::CANCELLED; } else if (request->has_param() && request->param().server_cancel_after_us()) { gpr_sleep_until(gpr_time_add( - gpr_now(), - gpr_time_from_micros(request->param().server_cancel_after_us()))); + gpr_now(GPR_CLOCK_REALTIME), + gpr_time_from_micros(request->param().server_cancel_after_us()))); return Status::CANCELLED; } else { EXPECT_FALSE(context->IsCancelled()); @@ -490,7 +490,8 @@ TEST_F(End2endTest, BadCredentials) { } void CancelRpc(ClientContext* context, int delay_us, TestServiceImpl* service) { - gpr_sleep_until(gpr_time_add(gpr_now(), gpr_time_from_micros(delay_us))); + gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), + gpr_time_from_micros(delay_us))); while (!service->signal_client()) { } context->TryCancel(); diff --git a/test/cpp/end2end/server_crash_test.cc b/test/cpp/end2end/server_crash_test.cc index 3fdae9bc07..4d4d590bdd 100644 --- a/test/cpp/end2end/server_crash_test.cc +++ b/test/cpp/end2end/server_crash_test.cc @@ -84,7 +84,8 @@ class ServiceImpl GRPC_FINAL gpr_log(GPR_INFO, "recv msg %s", request.message().c_str()); response.set_message(request.message()); stream->Write(response); - gpr_sleep_until(gpr_time_add(gpr_now(), gpr_time_from_seconds(1))); + gpr_sleep_until( + gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_seconds(1))); } return Status::OK; } @@ -98,7 +99,8 @@ class ServiceImpl GRPC_FINAL msg << "Hello " << i; response.set_message(msg.str()); if (!writer->Write(response)) break; - gpr_sleep_until(gpr_time_add(gpr_now(), gpr_time_from_seconds(1))); + gpr_sleep_until( + gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_seconds(1))); } return Status::OK; } @@ -145,7 +147,8 @@ class CrashTest : public ::testing::Test { TEST_F(CrashTest, ResponseStream) { auto server = CreateServerAndClient("response"); - gpr_sleep_until(gpr_time_add(gpr_now(), gpr_time_from_seconds(5))); + gpr_sleep_until( + gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_seconds(5))); KillClient(); server->Shutdown(); GPR_ASSERT(HadOneResponseStream()); @@ -154,7 +157,8 @@ TEST_F(CrashTest, ResponseStream) { TEST_F(CrashTest, BidiStream) { auto server = CreateServerAndClient("bidi"); - gpr_sleep_until(gpr_time_add(gpr_now(), gpr_time_from_seconds(5))); + gpr_sleep_until( + gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_seconds(5))); KillClient(); server->Shutdown(); GPR_ASSERT(HadOneBidiStream()); diff --git a/test/cpp/end2end/thread_stress_test.cc b/test/cpp/end2end/thread_stress_test.cc index 0b43dfd106..0b4d942566 100644 --- a/test/cpp/end2end/thread_stress_test.cc +++ b/test/cpp/end2end/thread_stress_test.cc @@ -96,14 +96,14 @@ class TestServiceImpl : public ::grpc::cpp::test::util::TestService::Service { } while (!context->IsCancelled()) { gpr_sleep_until(gpr_time_add( - gpr_now(), + gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_micros(request->param().client_cancel_after_us()))); } return Status::CANCELLED; } else if (request->has_param() && request->param().server_cancel_after_us()) { gpr_sleep_until(gpr_time_add( - gpr_now(), + gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_micros(request->param().server_cancel_after_us()))); return Status::CANCELLED; } else { |