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/13 23:16:07 UTC
[3/3] mesos git commit: Reduced HealthCheckTest.CheckCommandTimeout
test duration.
Reduced HealthCheckTest.CheckCommandTimeout test duration.
Review: https://reviews.apache.org/r/40956/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/f139333d
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/f139333d
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/f139333d
Branch: refs/heads/master
Commit: f139333db8264f25173c88e5a3f0db76680f3c52
Parents: f7434f1
Author: Timothy Chen <tn...@apache.org>
Authored: Wed Jan 13 13:23:50 2016 -0800
Committer: Timothy Chen <tn...@apache.org>
Committed: Wed Jan 13 14:15:58 2016 -0800
----------------------------------------------------------------------
src/tests/health_check_tests.cpp | 26 +++++++-------------------
1 file changed, 7 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/f139333d/src/tests/health_check_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/health_check_tests.cpp b/src/tests/health_check_tests.cpp
index 26d05e7..3606ce4 100644
--- a/src/tests/health_check_tests.cpp
+++ b/src/tests/health_check_tests.cpp
@@ -1041,20 +1041,16 @@ TEST_F(HealthCheckTest, CheckCommandTimeout)
EXPECT_NE(0u, offers.get().size());
vector<TaskInfo> tasks = populateTasks(
- "sleep 120", "sleep 120", offers.get()[0], 0, 3, None(), None(), 5);
+ "sleep 120", "sleep 120", offers.get()[0], 0, 1, None(), None(), 1);
- // Expecting four unhealthy updates and one final kill update.
+ // Expecting one unhealthy update and one final kill update.
Future<TaskStatus> statusRunning;
- Future<TaskStatus> status1;
- Future<TaskStatus> status2;
- Future<TaskStatus> status3;
+ Future<TaskStatus> statusUnhealthy;
Future<TaskStatus> statusKilled;
EXPECT_CALL(sched, statusUpdate(&driver, _))
.WillOnce(FutureArg<1>(&statusRunning))
- .WillOnce(FutureArg<1>(&status1))
- .WillOnce(FutureArg<1>(&status2))
- .WillOnce(FutureArg<1>(&status3))
+ .WillOnce(FutureArg<1>(&statusUnhealthy))
.WillOnce(FutureArg<1>(&statusKilled));
driver.launchTasks(offers.get()[0].id(), tasks);
@@ -1062,17 +1058,9 @@ TEST_F(HealthCheckTest, CheckCommandTimeout)
AWAIT_READY(statusRunning);
EXPECT_EQ(TASK_RUNNING, statusRunning.get().state());
- AWAIT_READY(status1);
- EXPECT_EQ(TASK_RUNNING, status1.get().state());
- EXPECT_FALSE(status1.get().healthy());
-
- AWAIT_READY(status2);
- EXPECT_EQ(TASK_RUNNING, status2.get().state());
- EXPECT_FALSE(status2.get().healthy());
-
- AWAIT_READY(status3);
- EXPECT_EQ(TASK_RUNNING, status3.get().state());
- EXPECT_FALSE(status3.get().healthy());
+ AWAIT_READY(statusUnhealthy);
+ EXPECT_EQ(TASK_RUNNING, statusUnhealthy.get().state());
+ EXPECT_FALSE(statusUnhealthy.get().healthy());
AWAIT_READY(statusKilled);
EXPECT_EQ(TASK_KILLED, statusKilled.get().state());