1
0
forked from aniani/vim

patch 8.1.0693: channel test fails sometimes

Problem:    Channel test fails sometimes.
Solution:   Avoid race condition.
This commit is contained in:
Bram Moolenaar
2019-01-05 00:35:22 +01:00
parent 8b62d87e42
commit f780b8a1c1
2 changed files with 5 additions and 4 deletions

View File

@@ -1650,17 +1650,16 @@ func Test_write_to_deleted_buffer()
return
endif
let job = job_start('echo hello', {'out_io': 'buffer', 'out_name': 'test_buffer', 'out_msg': 0})
call WaitForAssert({-> assert_equal("dead", job_status(job))})
let bufnr = bufnr('test_buffer')
call assert_equal(['hello'], getbufline(bufnr, 1, '$'))
call WaitForAssert({-> assert_equal(['hello'], getbufline(bufnr, 1, '$'))})
call assert_equal('nofile', getbufvar(bufnr, '&buftype'))
call assert_equal('hide', getbufvar(bufnr, '&bufhidden'))
bdel test_buffer
call assert_equal([], getbufline(bufnr, 1, '$'))
let job = job_start('echo hello', {'out_io': 'buffer', 'out_name': 'test_buffer', 'out_msg': 0})
call WaitForAssert({-> assert_equal("dead", job_status(job))})
call assert_equal(['hello'], getbufline(bufnr, 1, '$'))
call WaitForAssert({-> assert_equal(['hello'], getbufline(bufnr, 1, '$'))})
call assert_equal('nofile', getbufvar(bufnr, '&buftype'))
call assert_equal('hide', getbufvar(bufnr, '&bufhidden'))

View File

@@ -799,6 +799,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
693,
/**/
692,
/**/