[tarantool-patches] [PATCH 1/4] test: allow to run replication/misc multiple times
Alexander Turenko
alexander.turenko at tarantool.org
Wed Apr 10 16:28:42 MSK 2019
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).
---
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.20.1
More information about the Tarantool-patches
mailing list