patch 9.2.0234: test: Test_close_handle() is flaky
Commit:
https://github.com/vim/vim/commit/3abbe31fe035988c886e15d7e9ad3044ccec1b9b
Author: Yasuhiro Matsumoto <
matt...@gmail.com>
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 <
matt...@gmail.com>
Signed-off-by: Christian Brabandt <
c...@256bit.org>
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,
/**/