You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by an...@apache.org on 2018/04/10 23:09:04 UTC

mesos git commit: Windows: Changed `SLEEP_COMMAND` to use `ping`.

Repository: mesos
Updated Branches:
  refs/heads/master 88f5629e5 -> df89829de


Windows: Changed `SLEEP_COMMAND` to use `ping`.

We have gone back to `ping` as the `sleep` command on Windows, because
PowerShell is too slow to startup, and can crash when the machine is
overloaded. This time, however, the output of `ping` is redirected to
`NUL` so that the tests aren't spammed with spurious output when
sleeping.

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


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

Branch: refs/heads/master
Commit: df89829de5f6accffe92c74476cce319307422c2
Parents: 88f5629
Author: Eric Mumau <er...@microsoft.com>
Authored: Tue Apr 10 16:04:33 2018 -0700
Committer: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Committed: Tue Apr 10 16:07:45 2018 -0700

----------------------------------------------------------------------
 3rdparty/stout/include/stout/gtest.hpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/df89829d/3rdparty/stout/include/stout/gtest.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/gtest.hpp b/3rdparty/stout/include/stout/gtest.hpp
index ae0c3d5..a40e810 100644
--- a/3rdparty/stout/include/stout/gtest.hpp
+++ b/3rdparty/stout/include/stout/gtest.hpp
@@ -235,11 +235,15 @@ template <typename T1, typename T2>
 // with a count.  On Windows, `ping` waits one second between pings.
 // Additionally, because `ping` requires a count greater than 0,
 // we simply `exit 0` if the sleep is too short.
+//
+// This must not be replaced with `powershell -c Start-Sleep`, because
+// that causes flaky tests due to PowerShell crashing when a test
+// machine is overloaded. See MESOS-8308.
 #ifndef __WINDOWS__
 #define SLEEP_COMMAND(x) "sleep " #x
 #else
 #define SLEEP_COMMAND(x) \
-  "powershell -NoProfile -Command Start-Sleep -Seconds " #x
+  ((x) > 0 ? "ping 127.0.0.1 -n " #x " > NUL" : "cmd /C exit 0")
 #endif // __WINDOWS__