Issue #18792: Use "127.0.0.1" or "::1" instead of "localhost" as much as possible, since "localhost" goes through a DNS lookup under recent Windows versions.
diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/test_multiprocessing.py
index aa985e3..5760969 100644
--- a/Lib/test/test_multiprocessing.py
+++ b/Lib/test/test_multiprocessing.py
@@ -1968,7 +1968,7 @@
authkey = os.urandom(32)
manager = QueueManager(
- address=('localhost', 0), authkey=authkey, serializer=SERIALIZER
+ address=(test.support.HOST, 0), authkey=authkey, serializer=SERIALIZER
)
manager.start()
@@ -2006,7 +2006,7 @@
def test_rapid_restart(self):
authkey = os.urandom(32)
manager = QueueManager(
- address=('localhost', 0), authkey=authkey, serializer=SERIALIZER)
+ address=(test.support.HOST, 0), authkey=authkey, serializer=SERIALIZER)
srvr = manager.get_server()
addr = srvr.address
# Close the connection.Listener socket which gets opened as a part
@@ -2478,7 +2478,7 @@
l.close()
l = socket.socket()
- l.bind(('localhost', 0))
+ l.bind((test.support.HOST, 0))
l.listen(1)
conn.send(l.getsockname())
new_conn, addr = l.accept()
@@ -3235,9 +3235,9 @@
def test_wait_socket(self, slow=False):
from multiprocessing.connection import wait
l = socket.socket()
- l.bind(('', 0))
+ l.bind((test.support.HOST, 0))
l.listen(4)
- addr = ('localhost', l.getsockname()[1])
+ addr = l.getsockname()
readers = []
procs = []
dic = {}