You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by tn...@apache.org on 2016/01/15 00:31:43 UTC

mesos git commit: Fixed gmock warnings in hook tests.

Repository: mesos
Updated Branches:
  refs/heads/master d2f4b299f -> 764e3532f


Fixed gmock warnings in hook tests.

We did not have an expectation on the `shutdown` method of the `MockExecutor`.
This led to the gmock warning being emitted in some runs.

The tests that are being fixed are:

- `HookTest.VerifyMasterLaunchTaskHook`
- `HookTest.VerifySlaveRunTaskHook`
- `HookTest.VerifySlaveTaskStatusDecorator`

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


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

Branch: refs/heads/master
Commit: 764e3532f5116305ca0d6dd1053b4a4041a8abbb
Parents: d2f4b29
Author: Anand Mazumdar <ma...@gmail.com>
Authored: Thu Jan 14 14:58:36 2016 -0800
Committer: Timothy Chen <tn...@apache.org>
Committed: Thu Jan 14 14:58:36 2016 -0800

----------------------------------------------------------------------
 src/tests/hook_tests.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/764e3532/src/tests/hook_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/hook_tests.cpp b/src/tests/hook_tests.cpp
index 715b0b0..152984b 100644
--- a/src/tests/hook_tests.cpp
+++ b/src/tests/hook_tests.cpp
@@ -76,6 +76,7 @@ using std::string;
 using std::vector;
 
 using testing::_;
+using testing::AtMost;
 using testing::DoAll;
 using testing::Eq;
 using testing::Return;
@@ -212,6 +213,9 @@ TEST_F(HookTest, VerifyMasterLaunchTaskHook)
   EXPECT_EQ(testLabelKey, labels_.labels().Get(0).key());
   EXPECT_EQ(testLabelValue, labels_.labels().Get(0).value());
 
+  EXPECT_CALL(exec, shutdown(_))
+    .Times(AtMost(1));
+
   driver.stop();
   driver.join();
 
@@ -472,6 +476,9 @@ TEST_F(HookTest, VerifySlaveRunTaskHook)
   EXPECT_EQ("bar", labels_.labels(2).key());
   EXPECT_EQ("baz", labels_.labels(2).value());
 
+  EXPECT_CALL(exec, shutdown(_))
+    .Times(AtMost(1));
+
   driver.stop();
   driver.join();
 
@@ -598,6 +605,9 @@ TEST_F(HookTest, VerifySlaveTaskStatusDecorator)
   EXPECT_EQ("net_foo", networkInfoLabel.key());
   EXPECT_EQ("net_bar", networkInfoLabel.value());
 
+  EXPECT_CALL(exec, shutdown(_))
+    .Times(AtMost(1));
+
   driver.stop();
   driver.join();