Skip to content

Commit 769e9d2

Browse files
committed
patch 8.0.1697: various tests are still a bit flaky
Problem: Various tests are still a bit flaky. Solution: Increase the default wait time to five seconds.
1 parent d60e0a1 commit 769e9d2

7 files changed

Lines changed: 15 additions & 13 deletions

File tree

‎src/testdir/screendump.vim‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ func RunVimInTerminal(arguments, options)
6060
call assert_equal([rows, cols], term_getsize(buf))
6161

6262
" Wait for "All" of the ruler in the status line to be shown.
63-
" This can be quite slow (e.g. when using valgrind), wait up to 4 seconds.
64-
call WaitFor({-> len(term_getline(buf, rows)) >= cols - 1}, 4000)
63+
" This can be quite slow (e.g. when using valgrind).
64+
call WaitFor({-> len(term_getline(buf, rows)) >= cols - 1})
6565

6666
return buf
6767
endfunc
@@ -70,7 +70,7 @@ endfunc
7070
func StopVimInTerminal(buf)
7171
call assert_equal("running", term_getstatus(a:buf))
7272
call term_sendkeys(a:buf, "\<Esc>\<Esc>:qa!\<cr>")
73-
call WaitFor('term_getstatus(' . a:buf . ') == "finished"', 3000)
73+
call WaitFor('term_getstatus(' . a:buf . ') == "finished"')
7474
only!
7575
endfunc
7676

‎src/testdir/shared.vim‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,14 @@ func s:kill_server(cmd)
113113
endif
114114
endfunc
115115

116-
" Wait for up to a second for "expr" to become true. "expr" can be a
116+
" Wait for up to five seconds for "expr" to become true. "expr" can be a
117117
" stringified expression to evaluate, or a funcref without arguments.
118118
" A second argument can be used to specify a different timeout in msec.
119119
"
120120
" Return time slept in milliseconds. With the +reltime feature this can be
121121
" more than the actual waiting time. Without +reltime it can also be less.
122122
func WaitFor(expr, ...)
123-
let timeout = get(a:000, 0, 1000)
123+
let timeout = get(a:000, 0, 5000)
124124
" using reltime() is more accurate, but not always available
125125
if has('reltime')
126126
let start = reltime()

‎src/testdir/test_channel.vim‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,7 @@ func Test_pipe_to_buffer_raw()
11431143
let job = job_start([s:python, '-c',
11441144
\ 'import sys; [sys.stdout.write(".") and sys.stdout.flush() for _ in range(10000)]'], options)
11451145
call assert_equal("run", job_status(job))
1146-
call WaitFor('len(join(getline(1, "$"), "")) >= 10000', 3000)
1146+
call WaitFor('len(join(getline(1, "$"), "")) >= 10000')
11471147
try
11481148
let totlen = 0
11491149
for line in getline(1, '$')
@@ -1506,7 +1506,7 @@ func Test_exit_callback_interval()
15061506
let g:exit_cb_val = {'start': reltime(), 'end': 0, 'process': 0}
15071507
let job = job_start([s:python, '-c', 'import time;time.sleep(0.5)'], {'exit_cb': 'MyExitTimeCb'})
15081508
let g:exit_cb_val.process = job_info(job).process
1509-
call WaitFor('type(g:exit_cb_val.end) != v:t_number || g:exit_cb_val.end != 0', 2000)
1509+
call WaitFor('type(g:exit_cb_val.end) != v:t_number || g:exit_cb_val.end != 0')
15101510
let elapsed = reltimefloat(g:exit_cb_val.end)
15111511
call assert_true(elapsed > 0.5)
15121512
call assert_true(elapsed < 1.0)

‎src/testdir/test_clientserver.vim‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func Test_client_server()
3232

3333
" Takes a short while for the server to be active.
3434
" When using valgrind it takes much longer.
35-
call WaitFor('serverlist() =~ "' . name . '"', 5000)
35+
call WaitFor('serverlist() =~ "' . name . '"')
3636
call assert_match(name, serverlist())
3737

3838
call remote_foreground(name)

‎src/testdir/test_quotestar.vim‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,20 @@ func Do_test_quotestar_for_x11()
7474
" by the server.
7575
let @* = 'no'
7676
call remote_foreground(name)
77-
call WaitFor('remote_expr("' . name . '", "@*", "", 1) == "no"', 3000)
77+
call WaitFor('remote_expr("' . name . '", "@*", "", 1) == "no"')
7878

7979
" Set the * register on the server.
8080
call remote_send(name, ":let @* = 'yes'\<CR>")
81-
call WaitFor('remote_expr("' . name . '", "@*", "", 1) == "yes"', 3000)
81+
call WaitFor('remote_expr("' . name . '", "@*", "", 1) == "yes"')
8282

8383
" Check that the *-register of this vim instance is changed as expected.
84-
call WaitFor('@* == "yes"', 3000)
84+
call WaitFor('@* == "yes"')
8585

8686
" Handle the large selection over 262040 byte.
8787
let length = 262044
8888
let sample = 'a' . repeat('b', length - 2) . 'c'
8989
let @* = sample
90-
call WaitFor('remote_expr("' . name . '", "len(@*) >= ' . length . '", "", 1)', 3000)
90+
call WaitFor('remote_expr("' . name . '", "len(@*) >= ' . length . '", "", 1)')
9191
let res = remote_expr(name, "@*", "", 2)
9292
call assert_equal(length, len(res))
9393
" Check length to prevent a large amount of output at assertion failure.

‎src/testdir/test_terminal.vim‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ func Api_drop_common(options)
10611061
\ "set t_ts=",
10621062
\ ], 'Xscript')
10631063
let buf = RunVimInTerminal('-S Xscript', {})
1064-
call WaitFor({-> bufnr('Xtextfile') > 0}, 5000)
1064+
call WaitFor({-> bufnr('Xtextfile') > 0})
10651065
call assert_equal('Xtextfile', expand('%:t'))
10661066
call assert_true(winnr('$') >= 3)
10671067
return buf

‎src/version.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,8 @@ static char *(features[]) =
762762

763763
static int included_patches[] =
764764
{ /* Add new patch number below this line */
765+
/**/
766+
1697,
765767
/**/
766768
1696,
767769
/**/

0 commit comments

Comments
 (0)