You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2014/08/05 00:09:57 UTC
[36/43] git commit: Fix docker usage test
Fix docker usage test
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/f3d6d777
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/f3d6d777
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/f3d6d777
Branch: refs/heads/master
Commit: f3d6d77712c9153b1afbd334dd2a8083c52cfb9b
Parents: b5727ce
Author: Timothy Chen <tn...@gmail.com>
Authored: Wed Jul 9 01:38:34 2014 +0000
Committer: Benjamin Hindman <be...@gmail.com>
Committed: Mon Aug 4 15:08:17 2014 -0700
----------------------------------------------------------------------
src/tests/docker_containerizer_tests.cpp | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/f3d6d777/src/tests/docker_containerizer_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/docker_containerizer_tests.cpp b/src/tests/docker_containerizer_tests.cpp
index c3eee4d..2d1a287 100644
--- a/src/tests/docker_containerizer_tests.cpp
+++ b/src/tests/docker_containerizer_tests.cpp
@@ -66,6 +66,9 @@ public:
{
EXPECT_CALL(*this, launch(_, _, _, _, _, _, _, _))
.WillRepeatedly(Invoke(this, &MockDockerContainerizer::_launch));
+
+ EXPECT_CALL(*this, update(_, _))
+ .WillRepeatedly(Invoke(this, &MockDockerContainerizer::_update));
}
MOCK_METHOD8(
@@ -80,6 +83,12 @@ public:
const process::PID<slave::Slave>&,
bool checkpoint));
+ MOCK_METHOD2(
+ update,
+ process::Future<Nothing>(
+ const ContainerID&,
+ const Resources&));
+
// Default 'launch' implementation (necessary because we can't just
// use &DockerContainerizer::launch with 'Invoke').
process::Future<bool> _launch(
@@ -102,6 +111,15 @@ public:
slavePid,
checkpoint);
}
+
+ process::Future<Nothing> _update(
+ const ContainerID& containerId,
+ const Resources& resources)
+ {
+ return DockerContainerizer::update(
+ containerId,
+ resources);
+ }
};
@@ -265,6 +283,10 @@ TEST_F(DockerContainerizerTest, DOCKER_Usage)
Invoke(&dockerContainerizer,
&MockDockerContainerizer::_launch)));
+ // We ignore all update calls to prevent resizing cgroup limits.
+ EXPECT_CALL(dockerContainerizer, update(_, _))
+ .WillRepeatedly(Return(Nothing()));
+
Future<TaskStatus> statusRunning;
EXPECT_CALL(sched, statusUpdate(&driver, _))
.WillOnce(FutureArg<1>(&statusRunning))