]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0701: tests: test_terminal.vim does not wait for job to finish master v9.2.0701
authorVladimír Marek <vlmarek13@gmail.com>
Mon, 22 Jun 2026 18:04:06 +0000 (18:04 +0000)
committerChristian Brabandt <cb@256bit.org>
Mon, 22 Jun 2026 18:04:06 +0000 (18:04 +0000)
Problem:  tests: Test_terminal_eof_arg() and
          Test_terminal_duplicate_eof_arg() do not wait until the python
          job finishes
Solution: Wait for the job to be dead before checking its exit value
          (Vladimír Marek).

closes: #20571

Signed-off-by: Vladimír Marek <vlmarek13@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/testdir/test_terminal.vim
src/version.c

index fced4d158b377c8fdf8499849897fbf69697816e..98e82fcb4ccda10c4b7b69a0680c964d7b3e1c05 100644 (file)
@@ -942,7 +942,9 @@ func Test_terminal_eof_arg()
     call WaitFor({-> getline('$') =~ 'hello'})
     call assert_equal('hello', getline('$'))
   endif
     call WaitFor({-> getline('$') =~ 'hello'})
     call assert_equal('hello', getline('$'))
   endif
-  let exitval = bufnr()->term_getjob()->job_info().exitval
+  let job = bufnr()->term_getjob()
+  call WaitForAssert({-> assert_equal('dead', job_status(job))})
+  let exitval = job->job_info().exitval
   if !has('win32')
     call assert_equal(123, exitval)
   else
   if !has('win32')
     call assert_equal(123, exitval)
   else
@@ -984,7 +986,9 @@ func Test_terminal_duplicate_eof_arg()
     call WaitFor({-> getline('$') =~ 'hello'})
     call assert_equal('hello', getline('$'))
   endif
     call WaitFor({-> getline('$') =~ 'hello'})
     call assert_equal('hello', getline('$'))
   endif
-  let exitval = bufnr()->term_getjob()->job_info().exitval
+  let job = bufnr()->term_getjob()
+  call WaitForAssert({-> assert_equal('dead', job_status(job))})
+  let exitval = job->job_info().exitval
   if !has('win32')
     call assert_equal(123, exitval)
   else
   if !has('win32')
     call assert_equal(123, exitval)
   else
index ddd8a02ca6b3c0bd756b1d2b39c930a6503e632a..db18e0cc9259721e361d7c58eff2c1f4ba9f3508 100644 (file)
@@ -759,6 +759,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    701,
 /**/
     700,
 /**/
 /**/
     700,
 /**/