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 418776EC5D; Wed, 7 Apr 2021 15:16:37 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 418776EC5D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1617797797; bh=GjkenJXCcQ2+6LnaJnPTZKyfYLNoHZMkMIstTo6s0xU=; h=Date:In-Reply-To:To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=ENR+8UpuCWMLJm6GUZDadu6UB5yga1aJ66xRs19PkqrZ3hU+kksNzqVwTmQuBNixR aPVrLHOOi0giHPZW9pWXH76Og8yaTnCvyyXsTvGveUA9iQ/yqHfyP1IYANksY52Ueu as8WgiFkzZZqUQjClmP8ydqCepN2Jn8/xNlRBNcM= Received: from smtp49.i.mail.ru (smtp49.i.mail.ru [94.100.177.109]) (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 367356EC5D for ; Wed, 7 Apr 2021 15:16:35 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 367356EC5D Received: by smtp49.i.mail.ru with esmtpa (envelope-from ) id 1lU76o-00068m-5k; Wed, 07 Apr 2021 15:16:34 +0300 Message-Id: <68071F1B-A6AE-4826-BA62-5FFB04A38A51@tarantool.org> Content-Type: multipart/alternative; boundary="Apple-Mail=_4A02C5FE-5E81-4D00-AC1B-A16351726B48" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Date: Wed, 7 Apr 2021 15:16:33 +0300 In-Reply-To: <20210406183208.GG29703@tarantool.org> To: Igor Munkin References: <783A7DB3-75B7-4DA4-84CF-1BFA42B7C3AD@tarantool.org> <20210406183208.GG29703@tarantool.org> X-Mailer: Apple Mail (2.3654.60.0.2.21) X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD912A3E3D5D4B49FC1FB6C11AAC314D64EDF2811C24C4EA09700894C459B0CD1B95B534741EF0C7B8BD4D8424BE110206633831C85AB88A19E27673A5C93F18348 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE742D9BD90C58D50E0EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006374FA524FBD8B89EAA8638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B2B0081C385452503E9CD1E35C791261CCC247B71DA8F7637ED2E47CDBA5A96583C09775C1D3CA48CF17B107DEF921CE79117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE71AE4D56B06699BBC9FA2833FD35BB23DF004C90652538430302FCEF25BFAB3454AD6D5ED66289B5278DA827A17800CE7687A0D344F3E615AD32BA5DBAC0009BE395957E7521B51C20BC6067A898B09E4090A508E0FED6299176DF2183F8FC7C0ACA7D9B67BB80E4FCD04E86FAF290E2D7E9C4E3C761E06A71DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6AC294AFEFA671E80089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2AD77751E876CB595E8F7B195E1C978319B60BADB2A1F5E36D5B09C2752DC36E1 X-C1DE0DAB: 0D63561A33F958A58B2345AE2476B2F870439D33E6DC214BF668132D984D34B5D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34A9873270276D43347FDF52A002E73463F351A067E8C367CBD3E582CFAAA71C49A2DC7DB032A33BBA1D7E09C32AA3244C8327131362F58007695FE401E9C3B6DC259227199D06760AFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojAX27rRizpLk91o0jpNFXSA== X-Mailru-Sender: 455D65AE3A139168626D8C76E86D3AC05B534741EF0C7B8BD4D8424BE1102066DDAC019A3742A8B676D79013C85012CDC77752E0C033A69E4BBE7EBD99111A499D0AB74157175C036C18EFA0BB12DBB0 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" --Apple-Mail=_4A02C5FE-5E81-4D00-AC1B-A16351726B48 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Great, thanks for explanation and comments update! Sergos > On 6 Apr 2021, at 21:32, Igor Munkin wrote: >=20 > Sergos, >=20 > Thanks for your review! >=20 > On 06.04.21, Sergey Ostanevich wrote: >> Hi! >>=20 >> LGTM with some ignorable nits below. >=20 > Added your tag: > | Reviewed-by: Sergey Ostanevich > >=20 >>=20 >> Sergos >>=20 >>=20 >>> 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 >>=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 >=20 > Precisely. Honestly, it was a "soft" requirement for such tests (as I > have written above), but considering your attempts with implementing > tests for JIT machinery, I've finally realized this problem. >=20 >>=20 >>=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 > >=20 >>> 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 >>=20 >> 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 " >>=20 >>> + -- call, ... >>> + if os.getenv('TEST_SELFRUN') then return end >>> + >>> + -- ... otherwise run this chunk via . >>=20 >> I would add that the test payload won=E2=80=99t be run and the = io.popen results >> will be reported instead. >=20 > I've adjusted the comments the following way: >=20 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >=20 > diff --git a/test/tarantool-tests/utils.lua = b/test/tarantool-tests/utils.lua > index 9bdb71ec..c0403cf1 100644 > --- a/test/tarantool-tests/utils.lua > +++ b/test/tarantool-tests/utils.lua > @@ -25,11 +25,15 @@ local function unshiftenv(variable, value, sep) > end >=20 > function M.selfrun(arg, checks) > - -- If TEST_SELFRUN is set, just execute the test payload below > - -- call, ... > + -- If TEST_SELFRUN is set, it means the test has been run via > + -- , so just return from this routine and proceed > + -- the execution to the test payload, ... > if os.getenv('TEST_SELFRUN') then return end >=20 > - -- ... otherwise run this chunk via . > + -- ... otherwise initialize , setup testing environment > + -- and run this chunk via for each case in . > + -- XXX: The function doesn't return back from this moment. It > + -- checks whether all assertions are fine and exits. >=20 > local test =3D tap.test(arg[0]:match('/?(.+)%.test%.lua')) >=20 >=20 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >=20 >>=20 >>> + >>> 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