File tree Expand file tree Collapse file tree 2 files changed +21
-9
lines changed
Expand file tree Collapse file tree 2 files changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -304,16 +304,26 @@ func Test_connect_waittime()
304304 call assert_true (reltimefloat (elapsed) < 1.0 )
305305 endif
306306
307+ " We intend to use a socket that doesn't exist and wait for half a second
308+ " before giving up. If the socket does exist it can fail in various ways.
309+ " Check for "Connection reset by peer" to avoid flakyness.
307310 let start = reltime ()
308- let handle = ch_open (' localhost:9867' , {' waittime' : 500 })
309- if ch_status (handle) != " fail"
310- " Oops, port does exists.
311- call ch_close (handle)
312- else
313- " Failed connection should wait about 500 msec.
314- let elapsed = reltime (start )
315- call assert_true (reltimefloat (elapsed) < 1.0 )
316- endif
311+ try
312+ let handle = ch_open (' localhost:9867' , {' waittime' : 500 })
313+ if ch_status (handle) != " fail"
314+ " Oops, port does exists.
315+ call ch_close (handle)
316+ else
317+ " Failed connection should wait about 500 msec.
318+ let elapsed = reltime (start )
319+ call assert_true (reltimefloat (elapsed) > 0.3 )
320+ call assert_true (reltimefloat (elapsed) < 1.0 )
321+ endif
322+ catch
323+ if v: exception !~ ' Connection reset by peer'
324+ call assert_false (1 , " Caught exception: " . v: exception )
325+ endif
326+ endtry
317327endfunc
318328
319329func Test_raw_pipe ()
Original file line number Diff line number Diff line change @@ -747,6 +747,8 @@ static char *(features[]) =
747747
748748static int included_patches [] =
749749{ /* Add new patch number below this line */
750+ /**/
751+ 1377 ,
750752/**/
751753 1376 ,
752754/**/
You can’t perform that action at this time.
0 commit comments