You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by me...@apache.org on 2014/07/17 10:17:35 UTC
[2/2] git commit: Re-enabled health check tests
Re-enabled health check tests
Currently the health check tests are disabled as it was flaky. Part of the reason is that all assertions was EXPECTs instead of ASSERTs so it will continue to execute.
Another issue was it's currently discovering the path to launch health check executable from the command executor main argv[0] path.
However, the correct path is to launch the generated script that does library path resolution, which is the parent of .libs.
Review: https://reviews.apache.org/r/23443
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/7747a3d0
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/7747a3d0
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/7747a3d0
Branch: refs/heads/master
Commit: 7747a3d0351e05a4e5fa6cf2f5433e4d1621379c
Parents: ba387da
Author: Timothy Chen <tn...@apache.org>
Authored: Thu Jul 17 01:07:54 2014 -0700
Committer: Adam B <ad...@mesosphere.io>
Committed: Thu Jul 17 01:08:17 2014 -0700
----------------------------------------------------------------------
src/launcher/executor.cpp | 6 +++++-
src/tests/health_check_tests.cpp | 26 ++++++++++++++++----------
2 files changed, 21 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/7747a3d0/src/launcher/executor.cpp
----------------------------------------------------------------------
diff --git a/src/launcher/executor.cpp b/src/launcher/executor.cpp
index 7397b65..948673e 100644
--- a/src/launcher/executor.cpp
+++ b/src/launcher/executor.cpp
@@ -600,7 +600,11 @@ int main(int argc, char** argv)
}
}
- mesos::internal::CommandExecutor executor(override, dirname(argv[0]));
+ string path = os::getenv("MESOS_LAUNCHER_DIR", false);
+ if (path.empty()) {
+ path = os::realpath(dirname(argv[0])).get();
+ }
+ mesos::internal::CommandExecutor executor(override, path);
mesos::MesosExecutorDriver driver(&executor);
return driver.run() == mesos::DRIVER_STOPPED ? 0 : 1;
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/7747a3d0/src/tests/health_check_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/health_check_tests.cpp b/src/tests/health_check_tests.cpp
index 17e294e..7b0d04a 100644
--- a/src/tests/health_check_tests.cpp
+++ b/src/tests/health_check_tests.cpp
@@ -26,6 +26,7 @@
#include "slave/slave.hpp"
#include "tests/containerizer.hpp"
+#include "tests/flags.hpp"
#include "tests/mesos.hpp"
#include "tests/utils.hpp"
@@ -55,8 +56,7 @@ using std::string;
using std::map;
-// Temporarily disabled due to MESOS-1533.
-class DISABLED_HealthCheckTest : public MesosTest
+class HealthCheckTest : public MesosTest
{
public:
vector<TaskInfo> populateTasks(
@@ -75,6 +75,12 @@ public:
CommandInfo command;
command.set_value(cmd);
+ Environment::Variable* variable =
+ command.mutable_environment()->add_variables();
+ // We need to set the correct directory to launch health check process
+ // instead of the default for tests.
+ variable->set_name("MESOS_LAUNCHER_DIR");
+ variable->set_value(path::join(tests::flags.build_dir, "src"));
task.mutable_command()->CopyFrom(command);
@@ -84,11 +90,11 @@ public:
healthCommand.set_value(healthCmd);
if (env.isSome()) {
- foreachpair (const string& name, const string variable, env.get()) {
- Environment_Variable* var =
+ foreachpair (const string& name, const string value, env.get()) {
+ Environment::Variable* variable =
healthCommand.mutable_environment()->mutable_variables()->Add();
- var->set_name(name);
- var->set_value(variable);
+ variable->set_name(name);
+ variable->set_value(value);
}
}
@@ -112,7 +118,7 @@ public:
// Testing a healthy task reporting one healthy status to scheduler.
-TEST_F(DISABLED_HealthCheckTest, HealthyTask)
+TEST_F(HealthCheckTest, HealthyTask)
{
Try<PID<Master> > master = StartMaster();
ASSERT_SOME(master);
@@ -170,7 +176,7 @@ TEST_F(DISABLED_HealthCheckTest, HealthyTask)
// Testing killing task after number of consecutive failures.
-TEST_F(DISABLED_HealthCheckTest, ConsecutiveFailures)
+TEST_F(HealthCheckTest, ConsecutiveFailures)
{
Try<PID<Master> > master = StartMaster();
ASSERT_SOME(master);
@@ -255,7 +261,7 @@ TEST_F(DISABLED_HealthCheckTest, ConsecutiveFailures)
// Testing command using environment variable.
-TEST_F(DISABLED_HealthCheckTest, EnvironmentSetup)
+TEST_F(HealthCheckTest, EnvironmentSetup)
{
Try<PID<Master> > master = StartMaster();
ASSERT_SOME(master);
@@ -318,7 +324,7 @@ TEST_F(DISABLED_HealthCheckTest, EnvironmentSetup)
// Testing grace period that ignores all failed task failures.
-TEST_F(DISABLED_HealthCheckTest, GracePeriod)
+TEST_F(HealthCheckTest, GracePeriod)
{
Try<PID<Master> > master = StartMaster();
ASSERT_SOME(master);