From 3a6aadb3289be5114db6cce1c8c18b3f5f14d17c Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 4 Apr 2021 15:28:59 +0200 Subject: [PATCH] patch 8.2.2708: test sometimes fails waiting for shell in terminal Problem: Test sometimes fails waiting for shell in terminal. Solution: Use WaitForAssert() so we can see the actual job status. Use Run_shell_in_terminal(). --- src/testdir/term_util.vim | 4 ++-- src/testdir/test_mksession.vim | 4 ++-- src/version.c | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/testdir/term_util.vim b/src/testdir/term_util.vim index 8541ef353..de87dd420 100644 --- a/src/testdir/term_util.vim +++ b/src/testdir/term_util.vim @@ -23,7 +23,7 @@ endif func StopShellInTerminal(buf) call term_sendkeys(a:buf, "exit\r") let job = term_getjob(a:buf) - call WaitFor({-> job_status(job) == "dead"}) + call WaitForAssert({-> assert_equal("dead", job_status(job))}) endfunc " Wrapper around term_wait() to allow more time for re-runs of flaky tests @@ -160,7 +160,7 @@ endfunc " number. func Run_shell_in_terminal(options) if has('win32') - let buf = term_start([&shell,'/k'], a:options) + let buf = term_start([&shell, '/k'], a:options) else let buf = term_start(&shell, a:options) endif diff --git a/src/testdir/test_mksession.vim b/src/testdir/test_mksession.vim index 29d4360f0..fca1227d5 100644 --- a/src/testdir/test_mksession.vim +++ b/src/testdir/test_mksession.vim @@ -392,7 +392,7 @@ endfunc func Test_mksession_terminal_no_restore_funcarg() CheckFeature terminal - call term_start(&shell, {'norestore': 1}) + let buf = Run_shell_in_terminal({'norestore': 1}) mksession! Xtest_mks.out let lines = readfile('Xtest_mks.out') let term_cmd = '' @@ -402,7 +402,7 @@ func Test_mksession_terminal_no_restore_funcarg() endif endfor - call StopShellInTerminal(bufnr('%')) + call StopShellInTerminal(buf) call delete('Xtest_mks.out') endfunc diff --git a/src/version.c b/src/version.c index 754e6072f..2b0955c5a 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2708, /**/ 2707, /**/ -- 2.50.1