Skip to content

Commit 17f6754

Browse files
committed
patch 8.2.1497: CursorHold test is flaky
Problem: CursorHold test is flaky. (Jakub Kądziołka) Solution: Use WaitForAssert() (closes #6754)
1 parent b8a9296 commit 17f6754

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

src/testdir/test_autocmd.vim

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,19 @@ func Test_CursorHold_autocmd()
2929
END
3030
call writefile(before, 'Xinit')
3131
let buf = RunVimInTerminal('-S Xinit Xfile', {})
32-
call term_wait(buf)
32+
call term_sendkeys(buf, "G")
33+
call term_wait(buf, 20)
3334
call term_sendkeys(buf, "gg")
3435
call term_wait(buf)
35-
sleep 50m
36+
call WaitForAssert({-> assert_equal(['1'], readfile('Xoutput')[-1:-1])})
3637
call term_sendkeys(buf, "j")
3738
call term_wait(buf)
38-
sleep 50m
39+
call WaitForAssert({-> assert_equal(['1', '2'], readfile('Xoutput')[-2:-1])})
3940
call term_sendkeys(buf, "j")
4041
call term_wait(buf)
41-
sleep 50m
42+
call WaitForAssert({-> assert_equal(['1', '2', '3'], readfile('Xoutput')[-3:-1])})
4243
call StopVimInTerminal(buf)
4344

44-
call assert_equal(['1', '2', '3'], readfile('Xoutput')[-3:-1])
45-
4645
call delete('Xinit')
4746
call delete('Xoutput')
4847
call delete('Xfile')

src/version.c

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

755755
static int included_patches[] =
756756
{ /* Add new patch number below this line */
757+
/**/
758+
1497,
757759
/**/
758760
1496,
759761
/**/

0 commit comments

Comments
 (0)