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 E247E6EC5D; Tue, 6 Apr 2021 21:32:20 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E247E6EC5D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1617733941; bh=vrRhUSeTOLGHMEi6tGmiZZHgvaOSoREn11ViqGqf/aw=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=BuU4sQCx/1k3mafbrdWTCseoMG5pbxiYbLUIxkWUx9nZJGYpltmi7u6PVSGtNEWRF 6L1kXp75lvNbYExDTCrgi9Gz70dXsUoWvD4Tlakw2Foyo5ITF5hf5KaUOJVsNCwwjG +kvKERtVrcoWLZKWkCBqHfa7vJhfDTU14lyOfkek= Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (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 E13F26EC5D for ; Tue, 6 Apr 2021 21:32:19 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E13F26EC5D Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1lTqUs-0007Sn-NH; Tue, 06 Apr 2021 21:32:19 +0300 Date: Tue, 6 Apr 2021 21:32:08 +0300 To: Sergey Ostanevich Message-ID: <20210406183208.GG29703@tarantool.org> References: <783A7DB3-75B7-4DA4-84CF-1BFA42B7C3AD@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <783A7DB3-75B7-4DA4-84CF-1BFA42B7C3AD@tarantool.org> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.10.1 (2018-07-13) X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD912A3E3D5D4B49FC12DF659087DAACB92BFBA00DE2463A66B00894C459B0CD1B9004E3871710F2D4A1FB1F9F40141169187008BEDB2651F052059E94B53F79380 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE70A10A23A3B64B805EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063779089FB2CE4EA2908638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FC6375AA828CE7E65BA2952FFA69FD12C83484C2888E002A05389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C0D9442B0B5983000E8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B64854413538E1713FCC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB86D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE7D699F3A2029486C7731C566533BA786AA5CC5B56E945C8DA X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2AD77751E876CB595E8F7B195E1C9783193ACA72516585340D3DF300CDFC134A3 X-C1DE0DAB: 0D63561A33F958A53D67B3C9E8A37330374D0447282F511D8059412B67CF0DFED59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34AA13E2DDB9067862C5DE7C400E4DE4C50D70D9176218A0F31DE398D8F87E661CD262CE87457676791D7E09C32AA3244C420EBFA3E2785DD149DCB0317A80744C3A92A9747B6CC886927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojAX27rRizpLkI497mVa4y0Q== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822A56E77741F5BC53A14EDB2B2A546E066A7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E33667EA787935ED9F1B 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: Igor Munkin via Tarantool-patches Reply-To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Sergos, Thanks for your review! On 06.04.21, Sergey Ostanevich wrote: > Hi! > > LGTM with some ignorable nits below. Added your tag: | Reviewed-by: Sergey Ostanevich > > Sergos > > > > On 5 Apr 2021, at 20:11, Igor Munkin wrote: > > > > 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. > > > > As a result the function signals the testing system that the script is > > being run the second time via TEST_SELFRUN environment variable. > > > > 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. 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. > > > > 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(-) > > 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 > > > > 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’re 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’t be run and the io.popen results > will be reported instead. I've adjusted the comments the following way: ================================================================================ 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 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 - -- ... 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. local test = tap.test(arg[0]:match('/?(.+)%.test%.lua')) ================================================================================ > > > + > > local test = tap.test(arg[0]:match('/?(.+)%.test%.lua')) > > > > test:plan(#checks) > > @@ -28,6 +34,7 @@ function M.selfrun(arg, checks) > > local cmd = string.gsub('LUA_PATH="/?.lua;$LUA_PATH" ' .. > > 'LUA_CPATH="/?.;$LUA_CPATH" ' .. > > 'LD_LIBRARY_PATH=:$LD_LIBRARY_PATH ' .. > > + 'TEST_SELFRUN=1' .. > > ' 2>&1