You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ya...@apache.org on 2017/08/24 22:15:55 UTC

[2/2] mesos git commit: Fix garbage collection metrics test failures.

Fix garbage collection metrics test failures.

If we fail to garbage collect a path, verify that the failure is
recorded but don't depend on how many failures we encounter. This
ensures that we check what is important but don't bind to specific
values in a brittle wway.

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


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

Branch: refs/heads/master
Commit: 09b1625b5d83d6ade747b2cf0948c085a75f77c8
Parents: be8d7c2
Author: James Peach <jp...@apache.org>
Authored: Thu Aug 24 15:15:17 2017 -0700
Committer: Jiang Yan Xu <xu...@apple.com>
Committed: Thu Aug 24 15:15:17 2017 -0700

----------------------------------------------------------------------
 src/tests/gc_tests.cpp | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/09b1625b/src/tests/gc_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/gc_tests.cpp b/src/tests/gc_tests.cpp
index f451b2c..da9a31c 100644
--- a/src/tests/gc_tests.cpp
+++ b/src/tests/gc_tests.cpp
@@ -1004,7 +1004,7 @@ TEST_F(GarbageCollectorIntegrationTest, ROOT_BusyMountPoint)
   EXPECT_TRUE(os::exists(path::join(sandbox, mountPoint)));
   EXPECT_FALSE(os::exists(path::join(sandbox, regularFile)));
 
-  // Verify that GC metrics show that we performed 1 path removal that failed.
+  // Verify that GC metrics show that a path removal failed.
   JSON::Object metrics = Metrics();
 
   ASSERT_EQ(1u, metrics.values.count("gc/path_removals_pending"));
@@ -1017,9 +1017,14 @@ TEST_F(GarbageCollectorIntegrationTest, ROOT_BusyMountPoint)
   EXPECT_SOME_EQ(
       0u,
       metrics.at<JSON::Number>("gc/path_removals_succeeded"));
-  EXPECT_SOME_EQ(
-      1u,
-      metrics.at<JSON::Number>("gc/path_removals_failed"));
+
+  // The sandbox path removal failure will cascade to cause failures to
+  // remove the executor and framework directories. For testing purposes
+  // it is sufficient to verify that some failure was detected.
+  ASSERT_SOME(metrics.at<JSON::Number>("gc/path_removals_failed"));
+  EXPECT_GT(
+      metrics.at<JSON::Number>("gc/path_removals_failed")->as<unsigned>(),
+      0u);
 
   Clock::resume();
   driver.stop();