diff src/testdir/test_terminal.vim @ 19781:cadb4c1bee6e v8.2.0447

patch 8.2.0447: terminal scroll tests fails on some systems Commit: https://github.com/vim/vim/commit/bfcfd5784a2fe950d8e58d1d534bbbb4824524eb Author: Bram Moolenaar <Bram@vim.org> Date: Wed Mar 25 21:27:22 2020 +0100 patch 8.2.0447: terminal scroll tests fails on some systems Problem: Terminal scroll tests fails on some systems. Solution: Remove the fixed 100msec wait for Win32. Add a loop to wait until scrolling has finished. (James McCoy, closes #5842)
author Bram Moolenaar <Bram@vim.org>
date Wed, 25 Mar 2020 21:30:04 +0100
parents 4e843fc8772f
children d73d982499ae
line wrap: on
line diff
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -298,13 +298,16 @@ func Test_terminal_scroll()
   let job = term_getjob(buf)
   call WaitForAssert({-> assert_equal("dead", job_status(job))})
   call term_wait(buf)
-  if has('win32')
-    " TODO: this should not be needed
-    sleep 100m
-  endif
 
-  let scrolled = buf->term_getscrolled()
-  call assert_equal(scrolled, term_getscrolled(buf))
+  " wait until the scrolling stops
+  while 1
+    let scrolled = buf->term_getscrolled()
+    sleep 20m
+    if scrolled == buf->term_getscrolled()
+      break
+    endif
+  endwhile
+
   call assert_equal('1', getline(1))
   call assert_equal('1', term_getline(buf, 1 - scrolled))
   call assert_equal('49', getline(49))