patch 8.0.0045
Problem: Calling job_stop() right after job_start() does not work.
Solution: Block signals while fork is still busy. (Ozaki Kiichi, closes
#1155)
diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim
index e7ba667..0a50ed4 100644
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -1433,6 +1433,21 @@
call assert_fails('call job_start("")', 'E474:')
endfunc
+func Test_job_stop_immediately()
+ if !has('job')
+ return
+ endif
+
+ let job = job_start([s:python, '-c', 'import time;time.sleep(10)'])
+ try
+ call job_stop(job)
+ call WaitFor('"dead" == job_status(job)')
+ call assert_equal('dead', job_status(job))
+ finally
+ call job_stop(job, 'kill')
+ endtry
+endfunc
+
" This was leaking memory.
func Test_partial_in_channel_cycle()
let d = {}