You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by vi...@apache.org on 2014/05/22 00:20:30 UTC

git commit: Advanced clock to ensure GarbageCollector prune runs in test.

Repository: mesos
Updated Branches:
  refs/heads/master 4d5ed7a72 -> f9ff5f958


Advanced clock to ensure GarbageCollector prune runs in test.

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


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

Branch: refs/heads/master
Commit: f9ff5f958fc19dcaae020830650ed28757cea6a4
Parents: 4d5ed7a
Author: Dominic Hamon <dh...@twopensource.com>
Authored: Wed May 21 15:14:29 2014 -0700
Committer: Vinod Kone <vi...@twitter.com>
Committed: Wed May 21 15:20:23 2014 -0700

----------------------------------------------------------------------
 src/tests/gc_tests.cpp | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/f9ff5f95/src/tests/gc_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/gc_tests.cpp b/src/tests/gc_tests.cpp
index 19648fd..df15746 100644
--- a/src/tests/gc_tests.cpp
+++ b/src/tests/gc_tests.cpp
@@ -641,6 +641,13 @@ TEST_F(GarbageCollectorIntegrationTest, DiskUsage)
 
   Clock::settle(); // Wait for GarbageCollectorProcess::schedule to complete.
 
+  // We advance the clock here so that the 'removalTime' of the
+  // executor directory is definitely less than 'flags.gc_delay' in
+  // the GarbageCollectorProcess 'GarbageCollector::prune()' gets
+  // called (below). Otherwise, due to double comparison precision
+  // in 'prune()' the directory might not be deleted.
+  Clock::advance(Seconds(1));
+
   Future<Nothing> _checkDiskUsage =
     FUTURE_DISPATCH(_, &Slave::_checkDiskUsage);