From 0745356ab2262ea230cacbaf50b7d5622bef5e08 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Mon, 1 May 2017 13:52:03 -0700 Subject: Apply slowdown factor to timeouts --- test/cpp/end2end/grpclb_end2end_test.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/cpp/end2end/grpclb_end2end_test.cc b/test/cpp/end2end/grpclb_end2end_test.cc index 41e3448cef..8ebeba3522 100644 --- a/test/cpp/end2end/grpclb_end2end_test.cc +++ b/test/cpp/end2end/grpclb_end2end_test.cc @@ -306,16 +306,14 @@ class GrpclbEnd2endTest : public ::testing::Test { std::vector> SendRpc(const string& message, int num_rpcs, - int deadline_ms = 1000) { + int timeout_ms = 1000) { std::vector> results; EchoRequest request; EchoResponse response; - const auto deadline = std::chrono::system_clock::now() + - std::chrono::milliseconds(deadline_ms); request.set_message(message); for (int i = 0; i < num_rpcs; i++) { ClientContext context; - context.set_deadline(deadline); + context.set_deadline(grpc_timeout_milliseconds_to_deadline(timeout_ms)); Status status = stub_->Echo(&context, request, &response); results.push_back(std::make_pair(status, response)); } @@ -411,8 +409,8 @@ TEST_F(SingleBalancerTest, Vanilla) { } TEST_F(SingleBalancerTest, InitiallyEmptyServerlist) { - constexpr int kServerlistDelayMs = 500; - constexpr int kCallDeadlineMs = 1000; + const int kServerlistDelayMs = 500 * grpc_test_slowdown_factor(); + const int kCallDeadlineMs = 1000 * grpc_test_slowdown_factor(); // First response is an empty serverlist, sent right away. ScheduleResponseForBalancer(0, LoadBalanceResponse(), 0); -- cgit v1.2.3