aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2016-02-13 00:25:45 -0800
committerGravatar Vijay Pai <vpai@google.com>2016-02-13 00:25:45 -0800
commit8ca0faaf52b159236911bb309a029d73e9160e72 (patch)
tree5048cef069b85ba1aed78bd68cc1b783faef87f0 /test
parent8eef7e3b580bfe52f46844ea3a6f1c07485c7cbe (diff)
use timeouts with proper fixture multipliers rather than raw,
since tsan slows things down a lot and may complicate issues such as shutdown.
Diffstat (limited to 'test')
-rw-r--r--test/cpp/qps/driver.cc5
-rw-r--r--test/cpp/qps/server_async.cc3
2 files changed, 3 insertions, 5 deletions
diff --git a/test/cpp/qps/driver.cc b/test/cpp/qps/driver.cc
index 80f6ada409..e721966696 100644
--- a/test/cpp/qps/driver.cc
+++ b/test/cpp/qps/driver.cc
@@ -196,10 +196,7 @@ std::unique_ptr<ScenarioResult> RunScenario(
// Trim to just what we need
workers.resize(num_clients + num_servers);
- gpr_timespec deadline =
- gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
- gpr_time_from_seconds(
- warmup_seconds + benchmark_seconds + 20, GPR_TIMESPAN));
+ gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(20);
// Start servers
using runsc::ServerData;
diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc
index 1302d718f0..2024e0bfef 100644
--- a/test/cpp/qps/server_async.cc
+++ b/test/cpp/qps/server_async.cc
@@ -51,6 +51,7 @@
#include <gtest/gtest.h>
#include "src/proto/grpc/testing/services.grpc.pb.h"
+#include "test/core/util/test_config.h"
#include "test/cpp/qps/server.h"
namespace grpc {
@@ -129,7 +130,7 @@ class AsyncQpsServerTest : public Server {
}
}
~AsyncQpsServerTest() {
- auto deadline = std::chrono::system_clock::now() + std::chrono::seconds(10);
+ auto deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10);
server_->Shutdown(deadline);
for (auto ss = shutdown_state_.begin(); ss != shutdown_state_.end(); ++ss) {
(*ss)->set_shutdown();