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>
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()
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 234,
/**/
233,
/**/