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 2016/08/05 23:43:42 UTC

mesos git commit: Renamed the filter for tests that depend on "perf".

Repository: mesos
Updated Branches:
  refs/heads/master 5220f7758 -> 50f591a78


Renamed the filter for tests that depend on "perf".

Previously, any test case that had "Perf" in its name would only be run
when the perf(1) command was installed. This is inconsistent with other
name-based filters for test cases (e.g., "ROOT_" or "CGROUPS_"). It also
meant that the filter matched "Registrar_BENCHMARK_Test.Performance",
which was a bug (the test does not depend on perf).

Instead, use "PERF_" to indicate tests that can only be run when perf(1)
is installed.

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


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

Branch: refs/heads/master
Commit: 50f591a78f65f8a8d03dd7dde7f7420e5a90c770
Parents: 5220f77
Author: Neil Conway <ne...@gmail.com>
Authored: Fri Aug 5 16:43:29 2016 -0700
Committer: Vinod Kone <vi...@gmail.com>
Committed: Fri Aug 5 16:43:29 2016 -0700

----------------------------------------------------------------------
 src/tests/containerizer/cgroups_tests.cpp  |  2 +-
 src/tests/containerizer/isolator_tests.cpp |  4 ++--
 src/tests/containerizer/perf_tests.cpp     |  4 ++--
 src/tests/environment.cpp                  | 18 ++++++------------
 src/tests/slave_recovery_tests.cpp         |  2 +-
 5 files changed, 12 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/50f591a7/src/tests/containerizer/cgroups_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/cgroups_tests.cpp b/src/tests/containerizer/cgroups_tests.cpp
index d766f0f..821c786 100644
--- a/src/tests/containerizer/cgroups_tests.cpp
+++ b/src/tests/containerizer/cgroups_tests.cpp
@@ -971,7 +971,7 @@ public:
 };
 
 
-TEST_F(CgroupsAnyHierarchyWithPerfEventTest, ROOT_CGROUPS_Perf)
+TEST_F(CgroupsAnyHierarchyWithPerfEventTest, ROOT_CGROUPS_PERF_PerfTest)
 {
   int pipes[2];
   int dummy;

http://git-wip-us.apache.org/repos/asf/mesos/blob/50f591a7/src/tests/containerizer/isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/isolator_tests.cpp b/src/tests/containerizer/isolator_tests.cpp
index 4887473..827c9f0 100644
--- a/src/tests/containerizer/isolator_tests.cpp
+++ b/src/tests/containerizer/isolator_tests.cpp
@@ -1218,7 +1218,7 @@ TEST_F(NetClsIsolatorTest, ROOT_CGROUPS_ContainerStatus)
 class PerfEventIsolatorTest : public MesosTest {};
 
 
-TEST_F(PerfEventIsolatorTest, ROOT_CGROUPS_Sample)
+TEST_F(PerfEventIsolatorTest, ROOT_CGROUPS_PERF_Sample)
 {
   slave::Flags flags;
 
@@ -1602,7 +1602,7 @@ typedef ::testing::Types<
 TYPED_TEST_CASE(UserCgroupIsolatorTest, CgroupsIsolatorTypes);
 
 
-TYPED_TEST(UserCgroupIsolatorTest, ROOT_CGROUPS_UserCgroup)
+TYPED_TEST(UserCgroupIsolatorTest, ROOT_CGROUPS_PERF_UserCgroup)
 {
   slave::Flags flags = UserCgroupIsolatorTest<TypeParam>::CreateSlaveFlags();
   flags.perf_events = "cpu-cycles"; // Needed for CgroupsPerfEventIsolator.

http://git-wip-us.apache.org/repos/asf/mesos/blob/50f591a7/src/tests/containerizer/perf_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/perf_tests.cpp b/src/tests/containerizer/perf_tests.cpp
index 3dc5b0f..e5ee3e7 100644
--- a/src/tests/containerizer/perf_tests.cpp
+++ b/src/tests/containerizer/perf_tests.cpp
@@ -40,7 +40,7 @@ namespace tests {
 class PerfTest : public ::testing::Test {};
 
 
-TEST_F(PerfTest, ROOT_Events)
+TEST_F(PerfTest, ROOT_PERF_Events)
 {
   // Valid events.
   EXPECT_TRUE(perf::valid({"cycles", "task-clock"}));
@@ -50,7 +50,7 @@ TEST_F(PerfTest, ROOT_Events)
 }
 
 
-TEST_F(PerfTest, ROOT_Sample)
+TEST_F(PerfTest, ROOT_PERF_Sample)
 {
   // Sampling an empty set of cgroups should be a no-op.
   Future<hashmap<string, PerfStatistics>> sample =

http://git-wip-us.apache.org/repos/asf/mesos/blob/50f591a7/src/tests/environment.cpp
----------------------------------------------------------------------
diff --git a/src/tests/environment.cpp b/src/tests/environment.cpp
index 0d22c4b..6960c2a 100644
--- a/src/tests/environment.cpp
+++ b/src/tests/environment.cpp
@@ -588,11 +588,11 @@ public:
   bool disable(const ::testing::TestInfo* test) const
   {
     // Disable all tests that try to sample 'cpu-cycles' events using 'perf'.
-    return (matches(test, "ROOT_CGROUPS_Perf") ||
-            matches(test, "ROOT_CGROUPS_Sample") ||
-            matches(test, "ROOT_CGROUPS_UserCgroup") ||
-            matches(test, "CGROUPS_ROOT_PerfRollForward") ||
-            matches(test, "ROOT_Sample")) && perfError.isSome();
+    return (matches(test, "ROOT_CGROUPS_PERF_PerfTest") ||
+            matches(test, "ROOT_CGROUPS_PERF_Sample") ||
+            matches(test, "ROOT_CGROUPS_PERF_UserCgroup") ||
+            matches(test, "CGROUPS_ROOT_PERF_RollForward") ||
+            matches(test, "ROOT_CGROUPS_PERF_Sample")) && perfError.isSome();
   }
 
 private:
@@ -621,13 +621,7 @@ public:
 
   bool disable(const ::testing::TestInfo* test) const
   {
-    // Currently all tests that require 'perf' are part of the
-    // 'PerfTest' test fixture, hence we check for 'Perf' here.
-    //
-    // TODO(ijimenez): Replace all tests which require 'perf' with
-    // the prefix 'PERF_' to be more consistent with the filter
-    // naming we've done (i.e., ROOT_, CGROUPS_, etc).
-    return matches(test, "Perf") && perfError;
+    return matches(test, "PERF_") && perfError;
   }
 
 private:

http://git-wip-us.apache.org/repos/asf/mesos/blob/50f591a7/src/tests/slave_recovery_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/slave_recovery_tests.cpp b/src/tests/slave_recovery_tests.cpp
index 998d445..af442ca 100644
--- a/src/tests/slave_recovery_tests.cpp
+++ b/src/tests/slave_recovery_tests.cpp
@@ -4020,7 +4020,7 @@ TEST_F(MesosContainerizerSlaveRecoveryTest, ResourceStatistics)
 // Test that the perf event isolator can be enabled on a new slave.
 // Previously created containers will not report perf statistics but
 // newly created containers will.
-TEST_F(MesosContainerizerSlaveRecoveryTest, CGROUPS_ROOT_PerfRollForward)
+TEST_F(MesosContainerizerSlaveRecoveryTest, CGROUPS_ROOT_PERF_RollForward)
 {
   Try<Owned<cluster::Master>> master = this->StartMaster();
   ASSERT_SOME(master);