[Tarantool-patches] [PATCH v1 05/12] test: allow to run replication/misc multiple times

Alexander V. Tikhonov avtikhon at tarantool.org
Tue Nov 26 09:21:41 MSK 2019


From: Alexander Turenko <alexander.turenko at tarantool.org>

It allows to run `./test-run.py -j 1 replication/misc <...>
replication/misc` that can be useful when debugging a flaky problem.

This ability was broken after after 7474c14e ('test: enable cleaning of
a test environment'), because test-run starts to clean package.loaded
between runs and so each time the test is run it calls ffi.cdef() under
require('rlimit'). This ffi.cdef() call defines a structure, so a second
and following attempts to call the ffi.cdef() will give a Lua error.

This commit does not change anything in regular testing, because each
test runs once (if other is not stated in a configuration list).

(cherry picked from commit 7a2c31d39b3753fdee41424cdf17dfad396b2d3d)
---
 test/replication/lua/rlimit.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/replication/lua/rlimit.lua b/test/replication/lua/rlimit.lua
index 46026aea5..de9f86a35 100644
--- a/test/replication/lua/rlimit.lua
+++ b/test/replication/lua/rlimit.lua
@@ -1,6 +1,6 @@
 
 ffi = require('ffi')
-ffi.cdef([[
+pcall(ffi.cdef, [[
 typedef long rlim_t;
 struct rlimit {
     rlim_t rlim_cur;  /* Soft limit */
-- 
2.17.1



More information about the Tarantool-patches mailing list