You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by al...@apache.org on 2016/11/25 11:02:09 UTC

[4/4] mesos git commit: Avoided hardcoding ports in some tests.

Avoided hardcoding ports in some tests.

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


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

Branch: refs/heads/master
Commit: 79cee8ad9653ba2514d0d63ee53e05bb7f78ddc9
Parents: 9de5fb2
Author: Benjamin Bannier <be...@mesosphere.io>
Authored: Fri Nov 25 11:58:57 2016 +0100
Committer: Alexander Rukletsov <al...@apache.org>
Committed: Fri Nov 25 11:58:57 2016 +0100

----------------------------------------------------------------------
 .../containerizer/docker_containerizer_tests.cpp  |  2 +-
 src/tests/health_check_tests.cpp                  | 18 +++++++++---------
 2 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/79cee8ad/src/tests/containerizer/docker_containerizer_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/docker_containerizer_tests.cpp b/src/tests/containerizer/docker_containerizer_tests.cpp
index dee7a34..6035171 100644
--- a/src/tests/containerizer/docker_containerizer_tests.cpp
+++ b/src/tests/containerizer/docker_containerizer_tests.cpp
@@ -3970,7 +3970,7 @@ TEST_F(DockerContainerizerTest, ROOT_DOCKER_NoTransitionFromKillingToRunning)
   AWAIT_READY(offers);
   EXPECT_EQ(1u, offers->size());
 
-  const uint16_t testPort = 31001;
+  const uint16_t testPort = getFreePort().get();
 
   // Launch a HTTP server until SIGTERM is received, then sleep for
   // 15 seconds to let the health check fail.

http://git-wip-us.apache.org/repos/asf/mesos/blob/79cee8ad/src/tests/health_check_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/health_check_tests.cpp b/src/tests/health_check_tests.cpp
index 2c7022a..a4436bd 100644
--- a/src/tests/health_check_tests.cpp
+++ b/src/tests/health_check_tests.cpp
@@ -1339,7 +1339,7 @@ TEST_F(HealthCheckTest, HealthyTaskViaHTTP)
   AWAIT_READY(offers);
   EXPECT_NE(0u, offers.get().size());
 
-  const uint16_t testPort = 31001;
+  const uint16_t testPort = getFreePort().get();
 
   // Use `test-helper` to launch a simple HTTP
   // server to respond to HTTP health checks.
@@ -1421,7 +1421,7 @@ TEST_F(HealthCheckTest, HealthyTaskViaHTTPWithoutType)
   AWAIT_READY(offers);
   EXPECT_NE(0u, offers.get().size());
 
-  const uint16_t testPort = 31001;
+  const uint16_t testPort = getFreePort().get();
 
   // Use `test-helper` to launch a simple HTTP
   // server to respond to HTTP health checks.
@@ -1498,7 +1498,7 @@ TEST_F(HealthCheckTest, HealthyTaskViaTCP)
   AWAIT_READY(offers);
   EXPECT_NE(0u, offers.get().size());
 
-  const uint16_t testPort = 31001;
+  const uint16_t testPort = getFreePort().get();
 
   // Use `test-helper` to launch a simple HTTP
   // server to respond to TCP health checks.
@@ -1578,7 +1578,7 @@ TEST_F(HealthCheckTest, ROOT_INTERNET_CURL_HealthyTaskViaHTTPWithContainerImage)
   AWAIT_READY(offers);
   EXPECT_NE(0u, offers.get().size());
 
-  const uint16_t testPort = 31001;
+  const uint16_t testPort = getFreePort().get();
 
   // Use Netcat to launch a HTTP server.
   const string command = strings::format(
@@ -1663,7 +1663,7 @@ TEST_F(HealthCheckTest,
   AWAIT_READY(offers);
   EXPECT_NE(0u, offers.get().size());
 
-  const uint16_t testPort = 31001;
+  const uint16_t testPort = getFreePort().get();
 
   const string command = strings::format(
       "python https_server.py %u",
@@ -1755,7 +1755,7 @@ TEST_F(HealthCheckTest, ROOT_INTERNET_CURL_HealthyTaskViaTCPWithContainerImage)
   AWAIT_READY(offers);
   EXPECT_NE(0u, offers.get().size());
 
-  const uint16_t testPort = 31001;
+  const uint16_t testPort = getFreePort().get();
 
   // Use Netcat to launch a HTTP server.
   const string command = strings::format(
@@ -1851,7 +1851,7 @@ TEST_F(HealthCheckTest, ROOT_DOCKER_DockerHealthyTaskViaHTTP)
   AWAIT_READY(offers);
   EXPECT_NE(0u, offers.get().size());
 
-  const uint16_t testPort = 31001;
+  const uint16_t testPort = getFreePort().get();
 
   // Use Netcat to launch a HTTP server.
   const string command = strings::format(
@@ -1978,7 +1978,7 @@ TEST_F(HealthCheckTest, ROOT_DOCKER_DockerHealthyTaskViaHTTPS)
   AWAIT_READY(offers);
   EXPECT_NE(0u, offers.get().size());
 
-  const uint16_t testPort = 31001;
+  const uint16_t testPort = getFreePort().get();
 
   const string command = strings::format(
       "python https_server.py %u",
@@ -2110,7 +2110,7 @@ TEST_F(HealthCheckTest, ROOT_DOCKER_DockerHealthyTaskViaTCP)
   AWAIT_READY(offers);
   EXPECT_NE(0u, offers.get().size());
 
-  const uint16_t testPort = 31001;
+  const uint16_t testPort = getFreePort().get();
 
   // Use Netcat to launch a HTTP server.
   const string command = strings::format(