From c516586dc35b4ab8c691a5f234b90581582ccc85 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 5 Aug 2019 03:17:53 +0200 Subject: [PATCH] =?UTF-8?q?tests:=20fix=20flaky=20"TermClose=20=E2=80=A6?= =?UTF-8?q?=20fast-exiting=20terminal=20job=20stops"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This extra retry() was removed (at my suggestion) in 5b94a2977a22, but it is probably needed: jobwait(…, timeout=0) could return while channel_process_exit_cb() is still queued (so TermClose event didn't fire yet). 20:46:21,288 INFO - not ok 547 - TermClose event triggers when fast-exiting terminal job stops 20:46:21,288 INFO - # test/functional/autocmd/termclose_spec.lua @ 20 20:46:21,288 INFO - # Failure message: ./test/functional/helpers.lua:98: Vim:E121: Undefined variable: g:test_termclose 20:46:21,288 INFO - # stack traceback: 20:46:21,288 INFO - # ./test/functional/helpers.lua:98: in function 'eval' 20:46:21,288 INFO - # test/functional/autocmd/termclose_spec.lua:25: in function --- test/functional/autocmd/termclose_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/autocmd/termclose_spec.lua b/test/functional/autocmd/termclose_spec.lua index 26f2b5da1b..50bcf1af5a 100644 --- a/test/functional/autocmd/termclose_spec.lua +++ b/test/functional/autocmd/termclose_spec.lua @@ -22,7 +22,7 @@ describe('TermClose event', function() command('terminal') -- shell-test exits immediately. retry(nil, nil, function() neq(-1, eval('jobwait([&channel], 0)[0]')) end) - eq(23, eval('g:test_termclose')) + retry(nil, nil, function() eq(23, eval('g:test_termclose')) end) end) it('triggers when long-running terminal job gets stopped', function()