diff src/testdir/runtest.vim @ 19795:1c7f92a1100e v8.2.0454

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)
author Bram Moolenaar <Bram@vim.org>
date Thu, 26 Mar 2020 17:00:04 +0100
parents 2bd03926397a
children e373843e2980
line wrap: on
line diff
--- a/src/testdir/runtest.vim
+++ b/src/testdir/runtest.vim
@@ -406,7 +406,7 @@ for s:test in sort(s:tests)
   set belloff=all
   let prev_error = ''
   let total_errors = []
-  let run_nr = 1
+  let g:run_nr = 1
 
   " A test can set test_is_flaky to retry running the test.
   let test_is_flaky = 0
@@ -423,10 +423,10 @@ for s:test in sort(s:tests)
       call add(s:messages, 'Found errors in ' . s:test . ':')
       call extend(s:messages, v:errors)
 
-      call add(total_errors, 'Run ' . run_nr . ':')
+      call add(total_errors, 'Run ' . g:run_nr . ':')
       call extend(total_errors, v:errors)
 
-      if run_nr == 5 || prev_error == v:errors[0]
+      if g:run_nr == 5 || prev_error == v:errors[0]
         call add(total_errors, 'Flaky test failed too often, giving up')
         let v:errors = total_errors
         break
@@ -441,7 +441,7 @@ for s:test in sort(s:tests)
 
       let prev_error = v:errors[0]
       let v:errors = []
-      let run_nr += 1
+      let g:run_nr += 1
 
       call RunTheTest(s:test)