forked from aniani/vim
patch 7.4.1377
Problem: Test_connect_waittime() is flaky. Solution: Ignore the "Connection reset by peer" error.
This commit is contained in:
@@ -304,7 +304,11 @@ func Test_connect_waittime()
|
|||||||
call assert_true(reltimefloat(elapsed) < 1.0)
|
call assert_true(reltimefloat(elapsed) < 1.0)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" We intend to use a socket that doesn't exist and wait for half a second
|
||||||
|
" before giving up. If the socket does exist it can fail in various ways.
|
||||||
|
" Check for "Connection reset by peer" to avoid flakyness.
|
||||||
let start = reltime()
|
let start = reltime()
|
||||||
|
try
|
||||||
let handle = ch_open('localhost:9867', {'waittime': 500})
|
let handle = ch_open('localhost:9867', {'waittime': 500})
|
||||||
if ch_status(handle) != "fail"
|
if ch_status(handle) != "fail"
|
||||||
" Oops, port does exists.
|
" Oops, port does exists.
|
||||||
@@ -312,8 +316,14 @@ func Test_connect_waittime()
|
|||||||
else
|
else
|
||||||
" Failed connection should wait about 500 msec.
|
" Failed connection should wait about 500 msec.
|
||||||
let elapsed = reltime(start)
|
let elapsed = reltime(start)
|
||||||
|
call assert_true(reltimefloat(elapsed) > 0.3)
|
||||||
call assert_true(reltimefloat(elapsed) < 1.0)
|
call assert_true(reltimefloat(elapsed) < 1.0)
|
||||||
endif
|
endif
|
||||||
|
catch
|
||||||
|
if v:exception !~ 'Connection reset by peer'
|
||||||
|
call assert_false(1, "Caught exception: " . v:exception)
|
||||||
|
endif
|
||||||
|
endtry
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_raw_pipe()
|
func Test_raw_pipe()
|
||||||
|
@@ -747,6 +747,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 */
|
||||||
|
/**/
|
||||||
|
1377,
|
||||||
/**/
|
/**/
|
||||||
1376,
|
1376,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user