Fixed HealthyTaskNonShell test on Windows. Instead of using `TRUE_COMMAND`, we needed to use `add_arguments` for each argument to avoid smashing the set of arguments into one string. That is, we cannot execute `"cmd /c exit 0"`, we have to execute `"cmd"` with arguments `"cmd", "/c", "exit 0"`.
Review: https://reviews.apache.org/r/58161/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/b9d0893c Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/b9d0893c Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/b9d0893c Branch: refs/heads/master Commit: b9d0893c9aea8072c6634627f82da8c29454a395 Parents: bab04e1 Author: Andrew Schwartzmeyer <[email protected]> Authored: Tue Apr 4 14:29:18 2017 -0700 Committer: Joseph Wu <[email protected]> Committed: Tue Apr 4 16:45:17 2017 -0700 ---------------------------------------------------------------------- src/tests/health_check_tests.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/b9d0893c/src/tests/health_check_tests.cpp ---------------------------------------------------------------------- diff --git a/src/tests/health_check_tests.cpp b/src/tests/health_check_tests.cpp index 211f8b8..c5857b2 100644 --- a/src/tests/health_check_tests.cpp +++ b/src/tests/health_check_tests.cpp @@ -667,8 +667,15 @@ TEST_F(HealthCheckTest, HealthyTaskNonShell) CommandInfo command; command.set_shell(false); - command.set_value(TRUE_COMMAND); - command.add_arguments(TRUE_COMMAND); +#ifdef __WINDOWS__ + command.set_value(os::Shell::name); + command.add_arguments(os::Shell::arg0); + command.add_arguments(os::Shell::arg1); + command.add_arguments("exit 0"); +#else + command.set_value("true"); + command.add_arguments("true"); +#endif // __WINDOWS vector<TaskInfo> tasks = populateTasks(SLEEP_COMMAND(120), command, offers.get()[0]);
