diff options
author | Daniel Hahler <git@thequod.de> | 2019-08-09 15:32:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-09 15:32:38 +0200 |
commit | fa0c677a63079e5d27ff037ea8f1e23a71fe6680 (patch) | |
tree | 741923ebb87d689446127793721cda8e22e1fec7 /test/functional/helpers.lua | |
parent | 642e7daed53386fedd0ef3a97483d6ea2b43ca77 (diff) | |
download | rneovim-fa0c677a63079e5d27ff037ea8f1e23a71fe6680.tar.gz rneovim-fa0c677a63079e5d27ff037ea8f1e23a71fe6680.tar.bz2 rneovim-fa0c677a63079e5d27ff037ea8f1e23a71fe6680.zip |
tests/functional: expect_msg_seq: use load_adjust (#10727)
Regardless of the comment "Big timeout for ASAN/valgrind" it would use
10s by default already.
This changes it to use `load_adjust`, which itself is only computed on
CI now, and outside of any tests - since it has side effects when being
used the first time!
The failure seen on AppVeyor:
[ RUN ] jobs can get the pid value using getpid: ERR
test\functional\helpers.lua:167:
==============================================================================
got 0 messages (ignored 0), expected 1
stack traceback:
test\functional\helpers.lua:167: in function 'expect_msg_seq'
test/functional\core\job_spec.lua:288: in function <test/functional\core\job_spec.lua:281>
Log: https://ci.appveyor.com/project/neovim/neovim/builds/26537324/job/y1io66fbx399q7h6?fullLog=true#L6554
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r-- | test/functional/helpers.lua | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 4dde733e1e..d4ace3030c 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -165,11 +165,12 @@ function module.expect_msg_seq(...) end return string.format('%s\n%s\n%s', err1, string.rep('=', 78), err2) end + local msg_timeout = module.load_adjust(10000) -- Big timeout for ASAN/valgrind. for anum = 1, #seqs do local expected_seq = seqs[anum] -- Collect enough messages to compare the next expected sequence. while #actual_seq < #expected_seq do - local msg = module.next_msg(10000) -- Big timeout for ASAN/valgrind. + local msg = module.next_msg(msg_timeout) local msg_type = msg and msg[2] or nil if msg == nil then error(cat_err(final_error, @@ -770,14 +771,14 @@ function module.alter_slashes(obj) end end - -local load_factor = nil +local load_factor = 1 +if global_helpers.isCI() then + -- Compute load factor only once (but outside of any tests). + module.clear() + module.request('nvim_command', 'source src/nvim/testdir/load.vim') + load_factor = module.request('nvim_eval', 'g:test_load_factor') +end function module.load_adjust(num) - if load_factor == nil then -- Compute load factor only once. - module.clear() - module.request('nvim_command', 'source src/nvim/testdir/load.vim') - load_factor = module.request('nvim_eval', 'g:test_load_factor') - end return math.ceil(num * load_factor) end |