changeset 7988:d3fed9a639db v7.4.1289

commit https://github.com/vim/vim/commit/0fa98e7b85b52c63611b2fe8e370f0aa1c8f6dc9 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Feb 7 22:21:19 2016 +0100 patch 7.4.1289 Problem: Channel test fails on MS-Windows, connect() takes too long. Solution: Adjust the test for MS-Windows using "waittime".
author Christian Brabandt <cb@256bit.org>
date Sun, 07 Feb 2016 22:30:04 +0100
parents f49f393da704
children bae11b1fbe2f
files src/channel.c src/testdir/test_channel.vim src/version.c
diffstat 3 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/channel.c
+++ b/src/channel.c
@@ -468,7 +468,8 @@ channel_open(char *hostname, int port_in
 #endif
     }
 
-    if (errno == ECONNREFUSED)
+    /* Only retry for netbeans.  TODO: can we use a waittime instead? */
+    if (errno == ECONNREFUSED && close_cb != NULL)
     {
 	sock_close(sd);
 	if ((sd = (sock_T)socket(AF_INET, SOCK_STREAM, 0)) == (sock_T)-1)
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -196,8 +196,8 @@ func Test_connect_waittime()
     " Oops, port does exists.
     call ch_close(handle)
   else
-    " Failed connection doesn't wait the full time.
+    " Failed connection doesn't wait the full time on Unix.
     let elapsed = reltime(start)
-    call assert_true(reltimefloat(elapsed) < 1.0)
+    call assert_true(reltimefloat(elapsed) < (has('unix') ? 1.0 : 3.0))
   endif
 endfunc
--- a/src/version.c
+++ b/src/version.c
@@ -748,6 +748,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1289,
+/**/
     1288,
 /**/
     1287,