]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0234: test: Test_close_handle() is flaky v9.2.0234
authorYasuhiro Matsumoto <mattn.jp@gmail.com>
Mon, 23 Mar 2026 19:29:57 +0000 (19:29 +0000)
committerChristian Brabandt <cb@256bit.org>
Mon, 23 Mar 2026 19:29:57 +0000 (19:29 +0000)
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 <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/testdir/test_channel.vim
src/version.c

index f35b6d3cb12bea64dd63bc2ffb7e9ac3b7d7273a..203ae0428e83ee900a0aaa014b8e062f4b69e0cc 100644 (file)
@@ -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()
index de8f408dd3e75fb281ce4a9fb79eeccc135165e9..9c99fa79b65693b0ea26d899fe20e5b9c213ded2 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    234,
 /**/
     233,
 /**/