Repository: mesos
Updated Branches:
  refs/heads/master ee6c6cfcb -> 9accd9bd7


Windows: Fixed `ROOT_DOCKER_DockerHealthStatusChange` test.

The `ROOT_DOCKER_DockerHealthStatusChange` was broken if the test ran
in a drive other than `C:\`, since only `C:\` exists in the docker
container with the default settings. The test was changed to hardcode
the `C:\` drive on Windows.

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


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

Branch: refs/heads/master
Commit: 9accd9bd75eeedac54679eb5064ed308f2da71f6
Parents: ee6c6cf
Author: Akash Gupta <[email protected]>
Authored: Fri May 25 14:52:24 2018 -0700
Committer: Joseph Wu <[email protected]>
Committed: Fri May 25 14:52:24 2018 -0700

----------------------------------------------------------------------
 src/tests/health_check_tests.cpp | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/9accd9bd/src/tests/health_check_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/health_check_tests.cpp b/src/tests/health_check_tests.cpp
index 7e8f86c..e6eef5b 100644
--- a/src/tests/health_check_tests.cpp
+++ b/src/tests/health_check_tests.cpp
@@ -2553,11 +2553,13 @@ TEST_F(DockerContainerizerHealthCheckTest, 
ROOT_DOCKER_DockerHealthStatusChange)
   //
   // NOTE: On Windows, we delete a temporary directory instead since `del`
   // doesn't return an error if it tries to delete a nonexistent file, but
-  // `rmdir` does.
+  // `rmdir` does. Also, we hard code a path starting with `C:\` instead
+  // of using `tmpPath` since the path might not be possible to make inside
+  // the container (for example, if the `tmpPath` is in the `D:\` drive).
 #ifdef __WINDOWS__
+  const string dockerPath = path::join("C:", id::UUID::random().toString());
   const string healthCheckCmd =
-    "rmdir /s /q " + os::getcwd() + " || "
-    "(mkdir " + os::getcwd() + " && echo foo > " + tmpPath + " && exit 1)";
+    "rmdir /s /q " + dockerPath + " || (mkdir " + dockerPath + " && exit 1)";
 #else
   const string healthCheckCmd =
     "rm " + tmpPath + " || "

Reply via email to