aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/qps
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2015-06-03 11:34:53 -0700
committerGravatar Vijay Pai <vpai@google.com>2015-06-03 11:34:53 -0700
commit9dc5c15b563eae017a782a547d015d328fd015fe (patch)
tree12925d76b8eacb331fe5391a7476896f02266550 /test/cpp/qps
parent8559485c23e4c452c0f8dcc5329c902cea12ec80 (diff)
Account for time difference in mac and linux
Diffstat (limited to 'test/cpp/qps')
-rw-r--r--test/cpp/qps/client.h6
-rw-r--r--test/cpp/qps/client_async.cc5
2 files changed, 8 insertions, 3 deletions
diff --git a/test/cpp/qps/client.h b/test/cpp/qps/client.h
index f028fc7c0f..7d75ed7d74 100644
--- a/test/cpp/qps/client.h
+++ b/test/cpp/qps/client.h
@@ -44,17 +44,19 @@
namespace grpc {
-// Specialize Timepoint for high res clock as we need that
+#if defined(__APPLE__)
+// Specialize Timepoint for high res clock as we need that
template <>
class TimePoint<std::chrono::high_resolution_clock::time_point> {
public:
TimePoint(const std::chrono::high_resolution_clock::time_point& time) {
- Timepoint2Timespec(time, &time_);
+ TimepointHR2Timespec(time, &time_);
}
gpr_timespec raw_time() const { return time_; }
private:
gpr_timespec time_;
};
+#endif
namespace testing {
diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc
index e91a7a191c..e4ce93adb4 100644
--- a/test/cpp/qps/client_async.cc
+++ b/test/cpp/qps/client_async.cc
@@ -204,7 +204,7 @@ class AsyncClient : public Client {
short_deadline = issue_allowed_[thread_idx] ?
next_issue_[thread_idx] : deadline;
}
-
+
bool got_event;
switch (cli_cqs_[thread_idx]->AsyncNext(&got_tag, &ok, short_deadline)) {
@@ -215,6 +215,9 @@ class AsyncClient : public Client {
case CompletionQueue::GOT_EVENT:
got_event = true;
break;
+ default:
+ GPR_ASSERT(false);
+ break;
}
if (grpc_time_source::now() > deadline) {
// we have missed some 1-second deadline, which is too much gpr_log(GPR_INFO, "Missed an RPC deadline, giving up");