mirror of
https://github.com/vim/vim.git
synced 2025-10-09 06:14:17 -04:00
patch 9.0.1165: tests using IPv6 sometimes fail
Problem: Tests using IPv6 sometimes fail. Solution: Use getaddrinfo() and use try/catch. (James McCoy, closes #11783)
This commit is contained in:
committed by
Bram Moolenaar
parent
01c5f2addf
commit
765d82a657
@@ -259,7 +259,12 @@ def main(host, port, server_class=ThreadedTCPServer):
|
|||||||
print("Wait for it...")
|
print("Wait for it...")
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
|
|
||||||
server = server_class((host, port), ThreadedTCPRequestHandler)
|
addrs = socket.getaddrinfo(host, port, 0, 0, socket.IPPROTO_TCP)
|
||||||
|
# Each addr is a (family, type, proto, canonname, sockaddr) tuple
|
||||||
|
sockaddr = addrs[0][4]
|
||||||
|
server_class.address_family = addrs[0][0]
|
||||||
|
|
||||||
|
server = server_class(sockaddr[0:2], ThreadedTCPRequestHandler)
|
||||||
ip, port = server.server_address[0:2]
|
ip, port = server.server_address[0:2]
|
||||||
|
|
||||||
# Start a thread with the server. That thread will then start a new thread
|
# Start a thread with the server. That thread will then start a new thread
|
||||||
|
@@ -306,7 +306,12 @@ def main(host, port, server_class=ThreadedTCPServer):
|
|||||||
writePortInFile(port)
|
writePortInFile(port)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
|
|
||||||
server = server_class((host, port), ThreadedTCPRequestHandler)
|
addrs = socket.getaddrinfo(host, port, 0, 0, socket.IPPROTO_TCP)
|
||||||
|
# Each addr is a (family, type, proto, canonname, sockaddr) tuple
|
||||||
|
sockaddr = addrs[0][4]
|
||||||
|
server_class.address_family = addrs[0][0]
|
||||||
|
|
||||||
|
server = server_class(sockaddr[0:2], ThreadedTCPRequestHandler)
|
||||||
ip, port = server.server_address[0:2]
|
ip, port = server.server_address[0:2]
|
||||||
|
|
||||||
# Start a thread with the server. That thread will then start a new thread
|
# Start a thread with the server. That thread will then start a new thread
|
||||||
|
@@ -184,8 +184,13 @@ def writePortInFile(port):
|
|||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
HOST, PORT = "localhost", 0
|
HOST, PORT = "localhost", 0
|
||||||
|
|
||||||
server = ThreadedTCPServer((HOST, PORT), ThreadedTCPRequestHandler)
|
addrs = socket.getaddrinfo(HOST, PORT, 0, 0, socket.IPPROTO_TCP)
|
||||||
ip, port = server.server_address
|
# Each addr is a (family, type, proto, canonname, sockaddr) tuple
|
||||||
|
sockaddr = addrs[0][4]
|
||||||
|
ThreadedTCPServer.address_family = addrs[0][0]
|
||||||
|
|
||||||
|
server = ThreadedTCPServer(sockaddr[0:2], ThreadedTCPRequestHandler)
|
||||||
|
ip, port = server.server_address[0:2]
|
||||||
|
|
||||||
# Start a thread with the server. That thread will then start a new thread
|
# Start a thread with the server. That thread will then start a new thread
|
||||||
# for each connection.
|
# for each connection.
|
||||||
@@ -199,7 +204,7 @@ if __name__ == "__main__":
|
|||||||
# Main thread terminates, but the server continues running
|
# Main thread terminates, but the server continues running
|
||||||
# until server.shutdown() is called.
|
# until server.shutdown() is called.
|
||||||
try:
|
try:
|
||||||
while server_thread.isAlive():
|
while server_thread.is_alive():
|
||||||
server_thread.join(1)
|
server_thread.join(1)
|
||||||
except (KeyboardInterrupt, SystemExit):
|
except (KeyboardInterrupt, SystemExit):
|
||||||
server.shutdown()
|
server.shutdown()
|
||||||
|
@@ -887,6 +887,7 @@ func Nb_quit_with_conn(port)
|
|||||||
return filter(l, 'v:val !~ "^0:geometry="')
|
return filter(l, 'v:val !~ "^0:geometry="')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
try
|
||||||
" Establish the connection with the netbeans server
|
" Establish the connection with the netbeans server
|
||||||
exe 'nbstart :localhost:' .. g:port .. ':star'
|
exe 'nbstart :localhost:' .. g:port .. ':star'
|
||||||
call assert_true(has("netbeans_enabled"))
|
call assert_true(has("netbeans_enabled"))
|
||||||
@@ -909,6 +910,9 @@ func Nb_quit_with_conn(port)
|
|||||||
|
|
||||||
quit!
|
quit!
|
||||||
quit!
|
quit!
|
||||||
|
finally
|
||||||
|
qall!
|
||||||
|
endtry
|
||||||
END
|
END
|
||||||
if RunVim(['let g:port = ' .. a:port], after, '')
|
if RunVim(['let g:port = ' .. a:port], after, '')
|
||||||
call WaitFor('len(ReadXnetbeans()) >= 9')
|
call WaitFor('len(ReadXnetbeans()) >= 9')
|
||||||
|
@@ -695,6 +695,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1165,
|
||||||
/**/
|
/**/
|
||||||
1164,
|
1164,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user