patch 8.2.2700: nested autocmd test fails sometimes
Problem: Nested autocmd test fails sometimes.
Solution: Wait for the job to finish.
diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim
index e3a4b6e..6ea90b2 100644
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -2021,8 +2021,8 @@
let buf = term_start(cmd, #{term_finish: 'close', hidden: 1})
call assert_equal(lastline, line('.'))
- call TermWait(buf)
- exe buf . 'bwipe'
+ let job = term_getjob(buf)
+ call WaitForAssert({-> assert_equal("dead", job_status(job))})
call delete('Xtext')
augroup TermTest
au!