mirror of
https://github.com/neovim/neovim.git
synced 2025-11-17 15:51:32 +00:00
test: jobclose(): Avoid indeterminism. (#5851)
stdout activity may reach the queue before `exit`; just discard it.
Observed on Travis CI, ubuntu "trusty" beta image:
[ RUN ] ...is/build/neovim/neovim/test/functional/core/job_spec.lua @ 509: jobs running tty-test program jobclose() sends SIGHUP
...is/build/neovim/neovim/test/functional/core/job_spec.lua:511: Expected objects to be the same.
Passed in:
(table) {
[1] = 'notification'
*[2] = 'stdout'
[3] = {
[1] = 0
[2] = {
[1] = '
'
[2] = '' } } }
Expected:
(table) {
[1] = 'notification'
*[2] = 'exit'
[3] = {
[1] = 0
[2] = 42 } }
stack traceback:
...is/build/neovim/neovim/test/functional/core/job_spec.lua:511: in function <...is/build/neovim/neovim/test/functional/core/job_spec.lua:509>
[ FAILED ] ...is/build/neovim/neovim/test/functional/core/job_spec.lua @ 509: jobs running tty-test program jobclose() sends SIGHUP (2.81 ms)
This commit is contained in:
@@ -508,7 +508,9 @@ describe('jobs', function()
|
||||
|
||||
it('jobclose() sends SIGHUP', function()
|
||||
nvim('command', 'call jobclose(j)')
|
||||
eq({'notification', 'exit', {0, 42}}, next_msg())
|
||||
local msg = next_msg()
|
||||
msg = (msg[2] == 'stdout') and next_msg() or msg -- Skip stdout, if any.
|
||||
eq({'notification', 'exit', {0, 42}}, msg)
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user