From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 0920D4696C3 for ; Tue, 26 Nov 2019 09:21:54 +0300 (MSK) From: "Alexander V. Tikhonov" Date: Tue, 26 Nov 2019 09:21:41 +0300 Message-Id: <3e2226434ce01849224bcb2a0a9cc5f41a1f0529.1574749278.git.avtikhon@tarantool.org> In-Reply-To: <1c42ad20160f47d942cab405ce9896d6d31cc05f.1574749278.git.avtikhon@tarantool.org> References: <1c42ad20160f47d942cab405ce9896d6d31cc05f.1574749278.git.avtikhon@tarantool.org> In-Reply-To: <1c42ad20160f47d942cab405ce9896d6d31cc05f.1574749278.git.avtikhon@tarantool.org> References: <1c42ad20160f47d942cab405ce9896d6d31cc05f.1574749278.git.avtikhon@tarantool.org> Subject: [Tarantool-patches] [PATCH v1 05/12] test: allow to run replication/misc multiple times List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kirill Yukhin Cc: tarantool-patches@dev.tarantool.org From: Alexander Turenko 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