aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar David Garcia Quintas <dgq@google.com>2017-05-01 13:52:03 -0700
committerGravatar David Garcia Quintas <dgq@google.com>2017-05-01 13:52:15 -0700
commit0745356ab2262ea230cacbaf50b7d5622bef5e08 (patch)
tree256767caa250a052dea5b878327a371a6bb1547c /test
parentd8e278f3dc293594b6f0b8b9c46abdf643961960 (diff)
Apply slowdown factor to timeouts
Diffstat (limited to 'test')
-rw-r--r--test/cpp/end2end/grpclb_end2end_test.cc10
1 files changed, 4 insertions, 6 deletions
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<std::pair<Status, EchoResponse>> SendRpc(const string& message,
int num_rpcs,
- int deadline_ms = 1000) {
+ int timeout_ms = 1000) {
std::vector<std::pair<Status, EchoResponse>> 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);