Skip to content

Commit 4fa7ec8

Browse files
jamessanchrisbra
authored andcommitted
patch 9.1.1843: tests: Test_search_stat_option() may fail on slow systems
Problem: tests: Test_search_stat_option() may fail on slow systems Solution: test_search_stat: Extend searchcount() timeout if the test is being re-run due to flakiness (James McCoy). closes: #18524 Signed-off-by: James McCoy <jamessan@jamessan.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent 1388fa6 commit 4fa7ec8

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/testdir/test_search_stat.vim

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,10 @@ func Test_search_stat_option()
527527
" didn't get added to message history
528528
call assert_equal(messages_before, execute('messages'))
529529

530+
" If the test is being retried due to flakiness, extend the searchcount()
531+
" timeout, too
532+
let timeout = 500 * get(g:, 'run_nr', 1)
533+
530534
" Many matches
531535
call cursor(line('$')-2, 1)
532536
let @/ = '.'
@@ -539,10 +543,10 @@ func Test_search_stat_option()
539543
\ searchcount(#{recompute: 0}))
540544
call assert_equal(
541545
\ #{exact_match: 1, current: 27992, incomplete: 0, maxcount:0, total: 28000},
542-
\ searchcount(#{recompute: v:true, maxcount: 0, timeout: 500}))
546+
\ searchcount(#{recompute: v:true, maxcount: 0, timeout: timeout}))
543547
call assert_equal(
544548
\ #{exact_match: 1, current: 1, incomplete: 0, maxcount: 0, total: 28000},
545-
\ searchcount(#{recompute: 1, maxcount: 0, pos: [1, 1, 0], timeout: 500}))
549+
\ searchcount(#{recompute: 1, maxcount: 0, pos: [1, 1, 0], timeout: timeout}))
546550
call cursor(line('$'), 1)
547551
let g:a = execute(':unsilent :norm! n')
548552
let stat = 'W \[1/>999\]'
@@ -552,10 +556,10 @@ func Test_search_stat_option()
552556
\ searchcount(#{recompute: 0}))
553557
call assert_equal(
554558
\ #{current: 1, exact_match: 1, total: 28000, incomplete: 0, maxcount: 0},
555-
\ searchcount(#{recompute: 1, maxcount: 0, timeout: 500}))
559+
\ searchcount(#{recompute: 1, maxcount: 0, timeout: timeout}))
556560
call assert_equal(
557561
\ #{current: 27991, exact_match: 1, total: 28000, incomplete: 0, maxcount: 0},
558-
\ searchcount(#{recompute: 1, maxcount: 0, pos: [line('$')-2, 1, 0], timeout: 500}))
562+
\ searchcount(#{recompute: 1, maxcount: 0, pos: [line('$')-2, 1, 0], timeout: timeout}))
559563

560564
" Many matches
561565
call cursor(1, 1)

src/version.c

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

730730
static int included_patches[] =
731731
{ /* Add new patch number below this line */
732+
/**/
733+
1843,
732734
/**/
733735
1842,
734736
/**/

0 commit comments

Comments
 (0)