• R/O
  • SSH

vim: Commit

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

Revision1c7f92a1100ef3c1e409413336859df7bcdb0594 (tree)
Zeit2020-03-27 01:00:04
AutorBram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Log Message

patch 8.2.0454: some tests fail when the system is slow

Commit: https://github.com/vim/vim/commit/3ed9efc2b15b624268bcce4e4d312fb35840a12b
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Mar 26 16:50:57 2020 +0100

patch 8.2.0454: some tests fail when the system is slow
Problem: Some tests fail when the system is slow.
Solution: Make the run number global, use in the test to increase the
waiting time. (closes #5841)

Ändern Zusammenfassung

Diff

diff -r 37fc7cc2d83b -r 1c7f92a1100e src/testdir/runtest.vim
--- a/src/testdir/runtest.vim Thu Mar 26 16:30:04 2020 +0100
+++ b/src/testdir/runtest.vim Thu Mar 26 17:00:04 2020 +0100
@@ -406,7 +406,7 @@
406406 set belloff=all
407407 let prev_error = ''
408408 let total_errors = []
409- let run_nr = 1
409+ let g:run_nr = 1
410410
411411 " A test can set test_is_flaky to retry running the test.
412412 let test_is_flaky = 0
@@ -423,10 +423,10 @@
423423 call add(s:messages, 'Found errors in ' . s:test . ':')
424424 call extend(s:messages, v:errors)
425425
426- call add(total_errors, 'Run ' . run_nr . ':')
426+ call add(total_errors, 'Run ' . g:run_nr . ':')
427427 call extend(total_errors, v:errors)
428428
429- if run_nr == 5 || prev_error == v:errors[0]
429+ if g:run_nr == 5 || prev_error == v:errors[0]
430430 call add(total_errors, 'Flaky test failed too often, giving up')
431431 let v:errors = total_errors
432432 break
@@ -441,7 +441,7 @@
441441
442442 let prev_error = v:errors[0]
443443 let v:errors = []
444- let run_nr += 1
444+ let g:run_nr += 1
445445
446446 call RunTheTest(s:test)
447447
diff -r 37fc7cc2d83b -r 1c7f92a1100e src/testdir/test_functions.vim
--- a/src/testdir/test_functions.vim Thu Mar 26 16:30:04 2020 +0100
+++ b/src/testdir/test_functions.vim Thu Mar 26 17:00:04 2020 +0100
@@ -1832,6 +1832,17 @@
18321832 func Test_state()
18331833 CheckRunVimInTerminal
18341834
1835+ " In the first run try a short wait time. If the test fails retry with a
1836+ " longer wait time.
1837+ if g:run_nr == 1
1838+ let wait_time = 50
1839+ elseif g:run_nr == 2
1840+ let wait_time = 200
1841+ else
1842+ let wait_time = 500
1843+ endif
1844+ let getstate = ":echo 'state: ' .. g:state .. '; mode: ' .. g:mode\<CR>"
1845+
18351846 let lines =<< trim END
18361847 call setline(1, ['one', 'two', 'three'])
18371848 map ;; gg
@@ -1851,28 +1862,27 @@
18511862
18521863 " Using a timer callback
18531864 call term_sendkeys(buf, ":call RunTimer()\<CR>")
1854- call term_wait(buf, 50)
1855- let getstate = ":echo 'state: ' .. g:state .. '; mode: ' .. g:mode\<CR>"
1865+ call term_wait(buf, wait_time)
18561866 call term_sendkeys(buf, getstate)
18571867 call WaitForAssert({-> assert_match('state: c; mode: n', term_getline(buf, 6))}, 1000)
18581868
18591869 " Halfway a mapping
18601870 call term_sendkeys(buf, ":call RunTimer()\<CR>;")
1861- call term_wait(buf, 50)
1871+ call term_wait(buf, wait_time)
18621872 call term_sendkeys(buf, ";")
18631873 call term_sendkeys(buf, getstate)
18641874 call WaitForAssert({-> assert_match('state: mSc; mode: n', term_getline(buf, 6))}, 1000)
18651875
18661876 " Insert mode completion (bit slower on Mac)
18671877 call term_sendkeys(buf, ":call RunTimer()\<CR>Got\<C-N>")
1868- call term_wait(buf, 200)
1878+ call term_wait(buf, wait_time)
18691879 call term_sendkeys(buf, "\<Esc>")
18701880 call term_sendkeys(buf, getstate)
18711881 call WaitForAssert({-> assert_match('state: aSc; mode: i', term_getline(buf, 6))}, 1000)
18721882
18731883 " Autocommand executing
18741884 call term_sendkeys(buf, ":set filetype=foobar\<CR>")
1875- call term_wait(buf, 50)
1885+ call term_wait(buf, wait_time)
18761886 call term_sendkeys(buf, getstate)
18771887 call WaitForAssert({-> assert_match('state: xS; mode: n', term_getline(buf, 6))}, 1000)
18781888
@@ -1880,7 +1890,7 @@
18801890
18811891 " messages scrolled
18821892 call term_sendkeys(buf, ":call RunTimer()\<CR>:echo \"one\\ntwo\\nthree\"\<CR>")
1883- call term_wait(buf, 50)
1893+ call term_wait(buf, wait_time)
18841894 call term_sendkeys(buf, "\<CR>")
18851895 call term_sendkeys(buf, getstate)
18861896 call WaitForAssert({-> assert_match('state: Scs; mode: r', term_getline(buf, 6))}, 1000)
diff -r 37fc7cc2d83b -r 1c7f92a1100e src/version.c
--- a/src/version.c Thu Mar 26 16:30:04 2020 +0100
+++ b/src/version.c Thu Mar 26 17:00:04 2020 +0100
@@ -739,6 +739,8 @@
739739 static int included_patches[] =
740740 { /* Add new patch number below this line */
741741 /**/
742+ 454,
743+/**/
742744 453,
743745 /**/
744746 452,
Show on old repository browser