diff tests/test_push_command.py @ 1451:945700dac237

tests: use hostname instead of localhost The test_push_command test was failing on our machines because the machines are ipv6 but expose ipv4 on the 127.0.0.1 loopback interface. This caused the svnserve process to listen via ipv4, but the connecting process would attempt to connect on ipv6 and fail. Using the hostname causes it to listen using the primary network interface, which matches the interface that is used when the connecting client resolves the hostname. So the test now passes.
author Durham Goode <durham@fb.com>
date Tue, 07 Jun 2016 14:35:30 -0700
parents a36e87ae2380
children 6e3f48d8002f
line wrap: on
line diff
--- a/tests/test_push_command.py
+++ b/tests/test_push_command.py
@@ -138,7 +138,7 @@ class PushTests(test_util.TestBase):
         open(os.path.join(repo_path, 'conf', 'svnserve.conf'),
              'w').write('[general]\nanon-access=write\n[sasl]\n')
         self.port = random.randint(socket.IPPORT_USERRESERVED, 65535)
-        self.host = 'localhost'
+        self.host = socket.gethostname()
         args = ['svnserve', '--daemon', '--foreground',
                 '--listen-port=%d' % self.port,
                 '--listen-host=%s' % self.host,