Windows: Fixed flaky Docker command health check test.

The `DockerContainerizerHealthCheckTest.ROOT_DOCKER_
DockerHealthStatusChange` test was flaky on Windows, because
the Docker executor manually reaps the container exit code in
case that `docker run` fails to get the exit code. This logic
doesn't work on Windows, since the process might not be visible to
the container host machine, causing `TASK_FAILED` to get sent. By
removing the reaping logic on Windows, the test is much more reliable.



Branch: refs/heads/1.5.x
Commit: e524ac337b6fb53c6754f3f1636df720f81f96b0
Parents: a56b182
Author: Akash Gupta <>
Authored: Sun Feb 25 13:37:42 2018 -0800
Committer: Gilbert Song <>
Committed: Wed Mar 7 01:08:12 2018 -0800

 src/docker/executor.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/src/docker/executor.cpp b/src/docker/executor.cpp
index 80e2d81..ea47b44 100644
--- a/src/docker/executor.cpp
+++ b/src/docker/executor.cpp
@@ -277,6 +277,13 @@ public:
         // executor never returning although the container has already exited.
         // To workaround this issue, here we reap the container process 
         // so we will be notified when the container exits.
+        //
+        // The issue has only been reported on Linux, so it's not clear if
+        // Windows also has this issue. Regardless, we don't use this 
+        // for Windows, because the pid legitimately might not exist. For
+        // example, if the container is running in Hyper-V isolation, the pid
+        // will only exist in the guest OS.
+#ifndef __WINDOWS__
         if ( {
             .then(defer(self(), [=](const Option<int>& status) {
@@ -310,6 +317,7 @@ public:
+#endif // __WINDOWS__
         return Nothing();

Reply via email to