Skip to content
Snippets Groups Projects
Commit 0745356a authored by David Garcia Quintas's avatar David Garcia Quintas
Browse files

Apply slowdown factor to timeouts

parent d8e278f3
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment