From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 4D32D6EC5D; Tue, 6 Apr 2021 19:22:53 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 4D32D6EC5D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1617726173; bh=wBmbRz5BoBgFS+klqW3BIoKGAdKZXPbZ2MlPGBu3Hyw=; h=In-Reply-To:Date:References:To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=QDuWSDud2hSsh/+Unt8rLe6NU66JW9KzR0S3RX6E062D7hAgTAYr5SVjZguam50Ac rFuKZymBl1Tu/ksQmMuAhQDL5xLKarB9qVbbRbFQMYlgVqnHcAXCCcH0FA+XSPl1Rh KlEW95npXwg9m41B6bqv4/oqhrHbnJO1I3s429uI= Received: from smtp35.i.mail.ru (smtp35.i.mail.ru [94.100.177.95]) (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 61DE56EC5D for ; Tue, 6 Apr 2021 19:22:52 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 61DE56EC5D Received: by smtp35.i.mail.ru with esmtpa (envelope-from ) id 1lToTb-0001Kz-Iw; Tue, 06 Apr 2021 19:22:52 +0300 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) In-Reply-To: Date: Tue, 6 Apr 2021 19:22:50 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <783A7DB3-75B7-4DA4-84CF-1BFA42B7C3AD@tarantool.org> References: To: Igor Munkin X-Mailer: Apple Mail (2.3654.60.0.2.21) X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD912A3E3D5D4B49FC12DF659087DAACB92BFBA00DE2463A66B00894C459B0CD1B95378A562714EFA6991266D2FCBEED47CC4596507316DE671B8E9B88366A1DBEF X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7F65C230EDDCD559EEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006370D3D68FCEFFDD9EA8638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FC1B27C25F133D0DFAD0A45E1BC345AC6A635DA6EC9360A466389733CBF5DBD5E913377AFFFEAFD269A417C69337E82CC2CC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92A417C69337E82CC2CC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8D32BA5DBAC0009BE9E8FC8737B5C2249AE6B62100CB10EE23AA81AA40904B5D9CF19DD082D7633A078D18283394535A93AA81AA40904B5D98AA50765F7900637F9426D88B17ABCD9D81D268191BDAD3D698AB9A7B718F8C4D1B931868CE1C5781A620F70A64A45A98AA50765F79006372E808ACE2090B5E1725E5C173C3A84C3C5EA940A35A165FF2DBA43225CD8A89FB26E97DCB74E625235872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: 0D63561A33F958A523D17BA3A312996E7F91810CF314954E0388D17B0CCB38ABD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D347324AA9FA07FF01EF767C6E5D30841AD6754EA83EF677C8947EB51797F945DDA541A08A71AABE4991D7E09C32AA3244C0EC582BE28DA7EF7B9D891E4280F5B14E8FBBEFAE1C4874CFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojAX27rRizpLmHYa4LWuCCXQ== X-Mailru-Sender: 455D65AE3A139168626D8C76E86D3AC05378A562714EFA6991266D2FCBEED47CDDAC019A3742A8B676D79013C85012CDC77752E0C033A69E4BBE7EBD99111A499D0AB74157175C036C18EFA0BB12DBB0 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 2/3] test: make utils.selfrun usage easier X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Ostanevich via Tarantool-patches Reply-To: Sergey Ostanevich Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi! LGTM with some ignorable nits below. Sergos > On 5 Apr 2021, at 20:11, Igor Munkin wrote: >=20 > Previous implementation of implicitly obliges the > developer to pass the arguments to the test script for the second run. > This has been unnoticed, since the existing tests are invoked for two > different cases, so the script arguments were kinda obligatory, but = they > are not required in a general case. >=20 > As a result the function signals the testing system that the script is > being run the second time via TEST_SELFRUN environment variable. >=20 To me it looks like it was an infinite recursion, that was interrupted only by chance in case a test does not tolerate the reentrance.=20 > Signed-off-by: Igor Munkin > --- > .../gh-4427-ffi-sandwich.test.lua | 51 +++++++++---------- > .../lj-flush-on-trace.test.lua | 51 +++++++++---------- > test/tarantool-tests/utils.lua | 7 +++ > 3 files changed, 57 insertions(+), 52 deletions(-) >=20 > diff --git a/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua = b/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua > index 56363608..64df5dbd 100644 > --- a/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua > +++ b/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua > @@ -1,31 +1,30 @@ > -if #arg =3D=3D 0 then > - > - local utils =3D require('utils') > - > - -- Disabled on *BSD due to #4819. > - utils.skipcond(jit.os =3D=3D 'BSD', 'Disabled due to #4819') > - > - utils.selfrun(arg, { > - { > - arg =3D { > - 1, -- hotloop (arg[1]) > - 1, -- trigger (arg[2]) > - }, > - msg =3D 'Trace is aborted', > - res =3D tostring(3), -- hotloop + trigger + 1 > - test =3D 'is', > +local utils =3D require('utils') > + > +-- Disabled on *BSD due to #4819. > +utils.skipcond(jit.os =3D=3D 'BSD', 'Disabled due to #4819') > + > +utils.selfrun(arg, { > + { > + arg =3D { > + 1, -- hotloop (arg[1]) > + 1, -- trigger (arg[2]) > }, > - { > - arg =3D { > - 1, -- hotloop (arg[1]) > - 2, -- trigger (arg[2]) > - }, > - msg =3D 'Trace is recorded', > - res =3D 'Lua VM re%-entrancy is detected while executing the = trace', > - test =3D 'like', > + msg =3D 'Trace is aborted', > + res =3D tostring(3), -- hotloop + trigger + 1 > + test =3D 'is', > + }, > + { > + arg =3D { > + 1, -- hotloop (arg[1]) > + 2, -- trigger (arg[2]) > }, > - }) > -end > + msg =3D 'Trace is recorded', > + res =3D 'Lua VM re%-entrancy is detected while executing the = trace', > + test =3D 'like', > + }, > +}) > + > +----- Test payload. = ------------------------------------------------------------ >=20 > local cfg =3D { > hotloop =3D arg[1] or 1, > diff --git a/test/tarantool-tests/lj-flush-on-trace.test.lua = b/test/tarantool-tests/lj-flush-on-trace.test.lua > index 46fee533..edc5cf61 100644 > --- a/test/tarantool-tests/lj-flush-on-trace.test.lua > +++ b/test/tarantool-tests/lj-flush-on-trace.test.lua > @@ -1,31 +1,30 @@ > -if #arg =3D=3D 0 then > - > - local utils =3D require('utils') > - > - -- Disabled on *BSD due to #4819. > - utils.skipcond(jit.os =3D=3D 'BSD', 'Disabled due to #4819') > - > - utils.selfrun(arg, { > - { > - arg =3D { > - 1, -- hotloop (arg[1]) > - 1, -- trigger (arg[2]) > - }, > - msg =3D 'Trace is aborted', > - res =3D 'OK', > - test =3D 'is', > +local utils =3D require('utils') > + > +-- Disabled on *BSD due to #4819. > +utils.skipcond(jit.os =3D=3D 'BSD', 'Disabled due to #4819') > + > +utils.selfrun(arg, { > + { > + arg =3D { > + 1, -- hotloop (arg[1]) > + 1, -- trigger (arg[2]) > }, > - { > - arg =3D { > - 1, -- hotloop (arg[1]) > - 2, -- trigger (arg[2]) > - }, > - msg =3D 'Trace is recorded', > - res =3D 'JIT mode change is detected while executing the = trace', > - test =3D 'like', > + msg =3D 'Trace is aborted', > + res =3D 'OK', > + test =3D 'is', > + }, > + { > + arg =3D { > + 1, -- hotloop (arg[1]) > + 2, -- trigger (arg[2]) > }, > - }) > -end > + msg =3D 'Trace is recorded', > + res =3D 'JIT mode change is detected while executing the trace', > + test =3D 'like', > + }, > +}) > + > +----- Test payload. = ------------------------------------------------------------ >=20 > local cfg =3D { > hotloop =3D arg[1] or 1, > diff --git a/test/tarantool-tests/utils.lua = b/test/tarantool-tests/utils.lua > index aebbf6ac..d2dd71b0 100644 > --- a/test/tarantool-tests/utils.lua > +++ b/test/tarantool-tests/utils.lua > @@ -14,6 +14,12 @@ local function luacmd(args) > end >=20 > function M.selfrun(arg, checks) > + -- If TEST_SELFRUN is set, just execute the test payload below To make a symmetry to the next comment: "we=E2=80=99re running the = io.popen version of the test, proceed with test payload execution past " > + -- call, ... > + if os.getenv('TEST_SELFRUN') then return end > + > + -- ... otherwise run this chunk via . I would add that the test payload won=E2=80=99t be run and the io.popen = results will be reported instead. > + > local test =3D tap.test(arg[0]:match('/?(.+)%.test%.lua')) >=20 > test:plan(#checks) > @@ -28,6 +34,7 @@ function M.selfrun(arg, checks) > local cmd =3D string.gsub('LUA_PATH=3D"/?.lua;$LUA_PATH" ' .. > 'LUA_CPATH=3D"/?.;$LUA_CPATH" = ' .. > 'LD_LIBRARY_PATH=3D:$LD_LIBRARY_PATH ' = .. > + 'TEST_SELFRUN=3D1' .. > ' 2>&1