diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-09-02 18:01:13 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-09-03 16:14:29 +0200 |
commit | 58318af71844c71db1621706d1f6a7bbed8e8621 (patch) | |
tree | 88563e2bc1953518750da91eba9ec8586704d268 /test/functional/eval/api_functions_spec.lua | |
parent | a00eb23c27da7a0b79ea0030370074a1e383e457 (diff) | |
download | rneovim-58318af71844c71db1621706d1f6a7bbed8e8621.tar.gz rneovim-58318af71844c71db1621706d1f6a7bbed8e8621.tar.bz2 rneovim-58318af71844c71db1621706d1f6a7bbed8e8621.zip |
jobwait(): fix race if job exits before waiting on it
Problem: If a job exits while waiting on another job, the on_exit
handler is queued but f_jobwait() skips it.
Solution: Always do process_wait(), so that handlers are run during
f_jobwait().
fix #8302
Test case:
$ BUSTED_ARGS="--repeat=2000 --no-keep-going" TEST_FILE=test/functional/core/job_spec.lua TEST_FILTER=waiting make functionaltest
Failure example (macOS CI):
FAILED test/functional/core/job_spec.lua: jobs jobwait will run callbacks while waiting
test/functional/core/job_spec.lua:606: Expected objects to be the same.
Passed in:
(table: 0x1be77c80) {
[1] = 'notification'
[2] = 'wait'
*[3] = {
*[1] = 3 } }
Expected:
(table: 0x1be77d10) {
[1] = 'notification'
[2] = 'wait'
*[3] = {
*[1] = 4 } }
stack traceback:
test/functional/core/job_spec.lua:606: in function <test/functional/core/job_spec.lua:583
Diffstat (limited to 'test/functional/eval/api_functions_spec.lua')
0 files changed, 0 insertions, 0 deletions