This is an automated email from the ASF dual-hosted git repository.

dagit pushed a commit to branch master
in repository

The following commit(s) were added to refs/heads/master by this push:
     new 8530210  Uses known port, not rfc6890 loopback ip
8530210 is described below

commit 8530210942f4b519e0597b34fb85d009bd800b5f
Author: Derek Dagit <>
AuthorDate: Mon May 14 20:39:09 2018 +0000

    Uses known port, not rfc6890 loopback ip
    Some operating systems, like those derived from FreeBSD, will block for
    an unreasonable amount of time while attempting to connect to an IP
    address in the RFC6890 that is not the IPv4 loopback address
    Instead of using another IP address in the 127./8 block, create a
    microserver instance, which will "reserve" a port from the ephemeral
    range. We can then have more certainty that nothing should accept a
    connection to this port if we use the standard loopback address.
 .../gold_tests/headers/ | 14 +++++++-------
 .../headers/         |  7 ++++---
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/tests/gold_tests/headers/ 
index a5e2732..4749e20 100644
--- a/tests/gold_tests/headers/
+++ b/tests/gold_tests/headers/
@@ -1,10 +1,10 @@
-HTTP/1.1 502 connect failed
-Connection: keep-alive
-Cache-Control: no-store
-Content-Type: text/html
-Content-Language: en
-Content-Length: 247
+HTTP/1.1 502 connect failed
+Connection: keep-alive
+Cache-Control: no-store
+Content-Type: text/html
+Content-Language: en
+Content-Length: 247
 <TITLE>Could Not Connect</TITLE>
diff --git a/tests/gold_tests/headers/ 
index 4d785a8..7054ce9 100644
--- a/tests/gold_tests/headers/
+++ b/tests/gold_tests/headers/
@@ -25,10 +25,10 @@ Test response when connection to origin fails
 ts = Test.MakeATSProcess("ts")
 HOST = 'www.connectfail502.test'
-ARBITRARY_LOOPBACK_IP='' # This should fail to connect.
+server = Test.MakeOriginServer("server", ssl=False) # Reserves a port across 
-    'map http://{host} http://{ip}'.format(host=HOST, ip=ARBITRARY_LOOPBACK_IP)
+        'map http://{host} http://{ip}:{uport}'.format(host=HOST, 
ip='', uport=server.Variables.Port)
 Test.Setup.Copy(os.path.join(Test.Variables.AtsTestToolsDir, ''))
@@ -38,7 +38,8 @@ data_file.WriteOn("GET / HTTP/1.1\r\nHost: 
 tr = Test.AddTestRun()
-tr.Processes.Default.Command = "python {0} {1} | egrep 
-v '^(Date: |Server: ATS/)'"\
+# Do not start the origin server: We wish to simulate connection refused while 
hopefully no one else uses this port.
+tr.Processes.Default.Command = "python {0} {1} | sed 
-e '/^Date: /d' -e '/^Server: ATS\//d'"\
         .format(ts.Variables.port, "www.connectfail502.test-get.txt")
 tr.Processes.Default.ReturnCode = 0
 tr.Processes.Default.Streams.stdout = ''

To stop receiving notification emails like this one, please contact

Reply via email to