]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1843: tests: Test_search_stat_option() may fail on slow systems v9.1.1843
authorJames McCoy <jamessan@jamessan.com>
Thu, 9 Oct 2025 20:15:34 +0000 (20:15 +0000)
committerChristian Brabandt <cb@256bit.org>
Thu, 9 Oct 2025 20:15:34 +0000 (20:15 +0000)
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>
src/testdir/test_search_stat.vim
src/version.c

index fa3ddec2dbf1e513e70dcc976b1afaf7c6e6ea51..7e16dbd56454b4c956f91321493b3ce45d818a00 100644 (file)
@@ -527,6 +527,10 @@ func Test_search_stat_option()
   " didn't get added to message history
   call assert_equal(messages_before, execute('messages'))
 
+  " If the test is being retried due to flakiness, extend the searchcount()
+  " timeout, too
+  let timeout = 500 * get(g:, 'run_nr', 1)
+
   " Many matches
   call cursor(line('$')-2, 1)
   let @/ = '.'
@@ -539,10 +543,10 @@ func Test_search_stat_option()
     \ searchcount(#{recompute: 0}))
   call assert_equal(
     \ #{exact_match: 1, current: 27992, incomplete: 0, maxcount:0, total: 28000},
-    \ searchcount(#{recompute: v:true, maxcount: 0, timeout: 500}))
+    \ searchcount(#{recompute: v:true, maxcount: 0, timeout: timeout}))
   call assert_equal(
     \ #{exact_match: 1, current: 1, incomplete: 0, maxcount: 0, total: 28000},
-    \ searchcount(#{recompute: 1, maxcount: 0, pos: [1, 1, 0], timeout: 500}))
+    \ searchcount(#{recompute: 1, maxcount: 0, pos: [1, 1, 0], timeout: timeout}))
   call cursor(line('$'), 1)
   let g:a = execute(':unsilent :norm! n')
   let stat = 'W \[1/>999\]'
@@ -552,10 +556,10 @@ func Test_search_stat_option()
     \ searchcount(#{recompute: 0}))
   call assert_equal(
     \ #{current: 1, exact_match: 1, total: 28000, incomplete: 0, maxcount: 0},
-    \ searchcount(#{recompute: 1, maxcount: 0, timeout: 500}))
+    \ searchcount(#{recompute: 1, maxcount: 0, timeout: timeout}))
   call assert_equal(
     \ #{current: 27991, exact_match: 1, total: 28000, incomplete: 0, maxcount: 0},
-    \ searchcount(#{recompute: 1, maxcount: 0, pos: [line('$')-2, 1, 0], timeout: 500}))
+    \ searchcount(#{recompute: 1, maxcount: 0, pos: [line('$')-2, 1, 0], timeout: timeout}))
 
   " Many matches
   call cursor(1, 1)
index d63dcf21e90b3f78ae04f150b0bbf8dad75b010b..52c9a85ee4dfe8684e19eb20c583f839163eb5af 100644 (file)
@@ -729,6 +729,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1843,
 /**/
     1842,
 /**/