You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2014/04/24 20:31:33 UTC

git commit: Manipulated clock in metric tests to avoid rate limiting.

Repository: mesos
Updated Branches:
  refs/heads/master f0c952c70 -> dd03b9f4a


Manipulated clock in metric tests to avoid rate limiting.

Review: https://reviews.apache.org/r/20642


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/dd03b9f4
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/dd03b9f4
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/dd03b9f4

Branch: refs/heads/master
Commit: dd03b9f4a4733abe83de97067d067c9acfa15927
Parents: f0c952c
Author: Dominic Hamon <dh...@twopensource.com>
Authored: Thu Apr 24 11:30:44 2014 -0700
Committer: Benjamin Mahler <bm...@twitter.com>
Committed: Thu Apr 24 11:31:31 2014 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/src/tests/metrics_tests.cpp | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/dd03b9f4/3rdparty/libprocess/src/tests/metrics_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/tests/metrics_tests.cpp b/3rdparty/libprocess/src/tests/metrics_tests.cpp
index 6f3795b..294aed4 100644
--- a/3rdparty/libprocess/src/tests/metrics_tests.cpp
+++ b/3rdparty/libprocess/src/tests/metrics_tests.cpp
@@ -136,6 +136,11 @@ TEST(Metrics, Snapshot)
 
   UPID upid("metrics", process::ip(), process::port());
 
+  Clock::pause();
+
+  // Advance the clock to avoid rate limit.
+  Clock::advance(Seconds(1));
+
   // Before adding any metrics, the response should be empty.
   Future<Response> response = http::get(upid, "snapshot");
 
@@ -153,6 +158,9 @@ TEST(Metrics, Snapshot)
   AWAIT_READY(metrics::add(gauge));
   AWAIT_READY(metrics::add(counter));
 
+  // Advance the clock to avoid rate limit.
+  Clock::advance(Seconds(1));
+
   // Get the snapshot.
   response = http::get(upid, "snapshot");
   AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
@@ -166,6 +174,9 @@ TEST(Metrics, Snapshot)
   AWAIT_READY(metrics::remove(gauge));
   AWAIT_READY(metrics::remove(counter));
 
+  // Advance the clock to avoid rate limit.
+  Clock::advance(Seconds(1));
+
   response = http::get(upid, "snapshot");
   AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
   AWAIT_EXPECT_RESPONSE_BODY_EQ(stringify(JSON::Object()), response);
@@ -180,6 +191,10 @@ TEST(Metrics, SnapshotStatistics)
 {
   UPID upid("metrics", process::ip(), process::port());
 
+  Clock::pause();
+
+  // Advance the clock to avoid rate limit.
+  Clock::advance(Seconds(1));
   Future<Response> response = http::get(upid, "snapshot");
 
   AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);