patch 9.2.0234: test: Test_close_handle() is flaky

Commit: 
https://github.com/vim/vim/commit/3abbe31fe035988c886e15d7e9ad3044ccec1b9b
Author: Yasuhiro Matsumoto <[email protected]>
Date:   Mon Mar 23 19:29:57 2026 +0000

    patch 9.2.0234: test: Test_close_handle() is flaky
    
    Problem:  test: Test_close_handle() is flaky
    Solution: Use WaitForAssert() to wait for the channel to be closed
              (Yasuhiro Matsumoto)
    
    Ch_close_handle() did not wait for the channel to be fully closed,
    which could cause Ch_CloseHandler to fire during the next test's
    GetPort() sleep loop, resulting in E906.
    
    Wait for ch_status() to become 'closed' before returning.
    
    closes: #19797
    
    Signed-off-by: Yasuhiro Matsumoto <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim
index f35b6d3cb..203ae0428 100644
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -1475,6 +1475,9 @@ func Ch_close_handle(port)
   let s:channelfd = ch_open(s:address(a:port), s:chopt)
   call ch_sendexpr(s:channelfd, "test", {'callback': 
function('Ch_CloseHandler')})
   call WaitForAssert({-> assert_equal('what?', g:Ch_unletResponse)})
+  " Wait for the channel to be fully closed, so that the callback does not
+  " fire during the next test.
+  call WaitForAssert({-> assert_equal('closed', ch_status(s:channelfd))})
 endfunc
 
 func Test_close_handle()
diff --git a/src/version.c b/src/version.c
index de8f408dd..9c99fa79b 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 */
+/**/
+    234,
 /**/
     233,
 /**/

-- 
-- 
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/E1w4lCx-002XgG-K6%40256bit.org.

Raspunde prin e-mail lui