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 5C0D09F14D3; Tue, 6 Feb 2024 17:41:08 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5C0D09F14D3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1707230468; bh=fCUFTVziNrRJfzXXCZBcgm2j+DMzx5si85iqX205wt0=; 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=wddHfZMurz55H5d0ap1VY2OBHnEovVg1KckzV4weEVfoM7mhLQK4n2yUKda1aLGkD IcYKzol/sCIZaTzBp81sPyuhpZzqka1AqcSLvMFg05kHKUBIs9kiD8SrH3GZm595BC SCOI9pZFrpsCIU9hKeZBD5TeIDu6RIZ2689nVL8w= Received: from smtp55.i.mail.ru (smtp55.i.mail.ru [95.163.41.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 367469F14C1 for ; Tue, 6 Feb 2024 17:41:07 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 367469F14C1 Received: by smtp55.i.mail.ru with esmtpa (envelope-from ) id 1rXMdG-00000008FyB-05jJ; Tue, 06 Feb 2024 17:41:06 +0300 Date: Tue, 6 Feb 2024 17:37:08 +0300 To: Maxim Kokryashkin Message-ID: References: <3mp6fy366vr2sbxgr6tf2h7la62222a7esmwyhyacmtyed6s6b@adceh4obad4d> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3mp6fy366vr2sbxgr6tf2h7la62222a7esmwyhyacmtyed6s6b@adceh4obad4d> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD94C460F083DF69F5190553CFE4D3947DFB7946331AD157781182A05F5380850406EA446331DB74BC5C7A4B249DE6549FD231251AA4E11A7E033F47CDB25EE27B7712865981C6279A4 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE70A10A23A3B64B805EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637578F58D66D7052C48638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8CEEBF966E8532F372C129BF4E8016CF37B4E7B91179624FCCC7F00164DA146DAFE8445B8C89999728AA50765F790063783E00425F71A4181389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8EDCF5861DED71B2F389733CBF5DBD5E9B5C8C57E37DE458B9E9CE733340B9D5F3BBE47FD9DD3FB595F5C1EE8F4F765FCF1175FABE1C0F9B6E2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8BA56E11165BA017C7EFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A53933600E559E1E685002B1117B3ED696377128CCE8F9880B72305013E4AE841E823CB91A9FED034534781492E4B8EEAD32941D3B652364A4BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF0AAE4297931150BCA9F643503217B87103BF8E5C73A2F63BED34A0D75D53345D8135B9CF208C7BB7807D692F32DC70320736D4B2AFAEB583BF6FE336262329F59DC7407690CE02935F4332CA8FE04980913E6812662D5F2A5EAB5682573093F7837F15F2B5E4A70B33F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojh/iSjD2txnMlDWDUWd32Vw== X-DA7885C5: B9656659ADED5139F255D290C0D534F9F57B54CC38B206210DC3C0BDCE26B7799C5C950867B549DC5B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393590D8C940224AE3392C6DDBE870477413968CF92A11A470F7965231EC1898DA0E49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 22/26] test: enable LuaJIT test 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 Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Maxim! Thanks for the review! Fixed your comments below. On 01.02.24, Maxim Kokryashkin wrote: > Hi, Sergey! > Thanks for the patch! > Please consider my comments below. > > On Mon, Jan 29, 2024 at 01:45:22PM +0300, Sergey Kaplun wrote: > > This patch moves the test from the LuaJIT-tests suite to > > the tarantool-tests suite, because this test should be run separately to > > avoid overflow of the table with ctypes for other tests from > > LuaJIT-tests suite. > > > > Part of tarantool/tarantool#9398 > > --- > > test/LuaJIT-tests/lib/ffi/ffi_tabov.lua | 12 ----------- > > test/tarantool-tests/ffi-tabov.test.lua | 27 +++++++++++++++++++++++++ > > 2 files changed, 27 insertions(+), 12 deletions(-) > > delete mode 100644 test/LuaJIT-tests/lib/ffi/ffi_tabov.lua > > create mode 100644 test/tarantool-tests/ffi-tabov.test.lua > > > > diff --git a/test/LuaJIT-tests/lib/ffi/ffi_tabov.lua b/test/LuaJIT-tests/lib/ffi/ffi_tabov.lua > > deleted file mode 100644 > > index ba621960..00000000 > > --- a/test/LuaJIT-tests/lib/ffi/ffi_tabov.lua > > +++ /dev/null > > @@ -1,12 +0,0 @@ > > -local ffi = require("ffi") > > - > > -local last = 0 > > - > > -assert(pcall(function() > > - for i=1,65536 do > > - last = i > > - ffi.typeof"struct {}" > > - end > > -end) == false) > > - > > -assert(last > 20000) > > diff --git a/test/tarantool-tests/ffi-tabov.test.lua b/test/tarantool-tests/ffi-tabov.test.lua > > new file mode 100644 > > index 00000000..7ea8b24b > > --- /dev/null > > +++ b/test/tarantool-tests/ffi-tabov.test.lua > > @@ -0,0 +1,27 @@ > > +local tap = require('tap') > > +local ffi = require('ffi') > > + > > +-- This test is moved here from the LuaJIT-tests suite since it > > +-- should be run separately because it exhausts the ctype table. > > +local test = tap.test('ffi-tabov') > > + > > +test:plan(3) > > + > > +-- XXX: Amount of ctypes available to the user of a platform. > Where does this number comes from? Drop a comment. As you can see it was declared in the suite. I suppose this number is something empirical. So, I've mentioned that this was declared in the previous suite. > > +local MIN_AVAILABLE_CTYPES = 20000 > > + > > +local last = 0 > > + > > +local res, errmsg = pcall(function() > > + for i = 1, 2^16 do > Drop a comment explaining the number of iterations. Added, good suggestion! See the iterative patch below. =================================================================== diff --git a/test/tarantool-tests/ffi-tabov.test.lua b/test/tarantool-tests/ffi-tabov.test.lua index 7ea8b24b..7de7794d 100644 --- a/test/tarantool-tests/ffi-tabov.test.lua +++ b/test/tarantool-tests/ffi-tabov.test.lua @@ -8,12 +8,15 @@ local test = tap.test('ffi-tabov') test:plan(3) -- XXX: Amount of ctypes available to the user of a platform. +-- Was declared in the LuaJIT-tests suite. local MIN_AVAILABLE_CTYPES = 20000 +-- Maximum available amount of ctypes. +local CTID_MAX = 2^16 local last = 0 local res, errmsg = pcall(function() - for i = 1, 2^16 do + for i = 1, CTID_MAX do last = i ffi.typeof('struct {}') end =================================================================== > > + last = i > > -- Best regards, Sergey Kaplun