patch 9.2.0214: tests: Test_gui_system_term_scroll() is flaky

Commit: 
https://github.com/vim/vim/commit/2b7b745bb5bc16c189e21003315bc5525e339ae3
Author: Yasuhiro Matsumoto <[email protected]>
Date:   Fri Mar 20 22:34:11 2026 +0000

    patch 9.2.0214: tests: Test_gui_system_term_scroll() is flaky
    
    Problem:  tests: Test_gui_system_term_scroll() is flaky
              (after: v9.2.0208)
    Solution: Fix test (Yasuhiro Matsumoto)
    
    Remove timer-based screen check and use a simple command instead
    of ping.  The timer could fire before ConPTY initialization was
    complete, causing screenstring() to return an empty string.
    
    Check screenstring() directly after the command finishes instead.
    
    related: #19735
    closes:  #19765
    
    Signed-off-by: Yasuhiro Matsumoto <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/testdir/test_gui.vim b/src/testdir/test_gui.vim
index 0b0eb0271..c686094ca 100644
--- a/src/testdir/test_gui.vim
+++ b/src/testdir/test_gui.vim
@@ -973,31 +973,18 @@ func Test_gui_system_term_scroll()
   call setline(1, repeat(['AAAA'], &lines + 5))
   redraw
 
-  " Timer fires during terminal_loop to check the screen while the command
-  " is still running.  Row 1 should still show buffer content if scrolling
-  " is correct.
-  let g:system_term_row1 = ''
-  func s:CheckScroll(timer)
-    let g:system_term_row1 = screenstring(1, 1)
-  endfunc
-  call timer_start(200, function('s:CheckScroll'))
-
-  " Use a command that runs long enough for the timer to fire during
-  " terminal_loop.  wait_return() returns immediately when sourcing a script,
-  " so the timer must fire before the command finishes.
   if has('win32')
-    !ping -n 2 127.0.0.1 > nul
+    !echo.
   else
-    !sleep 1
+    !echo
   endif
 
   " With the ConPTY scroll bug, the screen scrolled up entirely and row 1
   " became blank.  With the fix, only the output lines scroll and the buffer
   " content remains visible near the top of the screen.
-  call assert_equal('A', g:system_term_row1)
+  call assert_equal('A', screenstring(1, 1))
 
   %bwipe!
-  delfunc s:CheckScroll
   let &guioptions = save_guioptions
 endfunc
 
diff --git a/src/version.c b/src/version.c
index 42ebf261e..3f5c22316 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    214,
 /**/
     213,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1w3iaX-00FOek-3K%40256bit.org.

Raspunde prin e-mail lui