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 C81661320057; Wed, 5 Mar 2025 18:09:56 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C81661320057 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1741187396; bh=RN9P4/upmwXNJtJKId3KcaFLiip8u/zLMtFyBegF9ZA=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=xeA9z9b+rhsdDd/iTwK2ejeuff8eUkzlWYMSjRMorkXWg/pTFGH4JmbzIl3frlGyW myeGGiRsamhIw2eYd2PLKPjj50QMFlgynt93IjbawK3cgxVZ+uZD7tnUejdc2C8Vzl pCCpAA0kWamCKR8npPnSzhgPVdbePASxguWNYgho= Received: from send194.i.mail.ru (send194.i.mail.ru [95.163.59.33]) (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 348C3CED610 for ; Wed, 5 Mar 2025 18:09:55 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 348C3CED610 Received: by exim-smtp-8cb569c79-sc8nh with esmtpa (envelope-from ) id 1tpqNe-00000000PqI-0zhz; Wed, 05 Mar 2025 18:09:54 +0300 Content-Type: multipart/alternative; boundary="------------JocDeElx4978qmh37bnQgg20" Message-ID: Date: Wed, 5 Mar 2025 18:09:53 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun Cc: Sergey Bronnikov , tarantool-patches@dev.tarantool.org References: <80360fb2e570ce8d54ff59ccf0bcd5dfb6b98527.1739362814.git.sergeyb@tarantool.org> <93178b00-f3e0-4145-932f-bd273935a477@tarantool.org> <96d32e1d-eed2-4c64-b6fd-7743ab03051a@tarantool.org> In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9C8AED3E6A44DB6ABDD9CEB5AA6031299DC2A0753C2BEEB50182A05F538085040668015C926D6E6983DE06ABAFEAF67055F28DEFB3CB47A431B4A8E48FAFD2319DA770512DEBA4741 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7ECD3FEFFF0C7120DC2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6759CC434672EE6371C2A783ECEC0211ADC4224003CC836476D5A39DEEDB180909611E41BBFE2FEB2B90EA890294B906E996096F74A24BB9A4A2A50126B39788EA4D633128FFEC7F2C9FA2833FD35BB23D9E625A9149C048EE33AC447995A7AD18F04B652EEC242312D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8B60CDF180582EB8FBA471835C12D1D977C4224003CC836476EB9C4185024447017B076A6E789B0E975F5C1EE8F4F765FC6A4E49BB0F3BA1413AA81AA40904B5D9CF19DD082D7633A0C84D3B47A649675F3AA81AA40904B5D98AA50765F79006371C58C39218EE08BCD81D268191BDAD3D3666184CF4C3C14F3FC91FA280E0CE3D1A620F70A64A45A98AA50765F79006372E808ACE2090B5E1725E5C173C3A84C3C5EA940A35A165FF2DBA43225CD8A89F616AD31D0D18CD5C57739F23D657EF2BB5C8C57E37DE458BEDA766A37F9254B7 X-C1DE0DAB: 0D63561A33F958A54656488B32BCB4195002B1117B3ED69681A39C074684A7DBF5FEB6EB1EB183FD823CB91A9FED034534781492E4B8EEAD528DE7AA5F2BD788BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF6473BBE978F500FA6F1B40EDBA87F515D54D44DC988DDDD455F2D7689FEDE65990F5B3B6BD0F620E2C10F42E4F22A8B61AF1C233E367A61C1ADF787AECFF2F32CCDCBA68B1BA31DC5F4332CA8FE04980913E6812662D5F2AB9AF64DB4688768036DF5FE9C0001AF333F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVQiWK+2I7Y2srG5ZKTQuW+g= X-Mailru-Sender: 520A125C2F17F0B1E52FEF5D219D6140484D3AB75F01751006104296DCCA83D2C95423C780E270460152A3D17938EB451EB5A0BCEC6A560B3DDE9B364B0DF289BE2DA36745F2EEB5CEBA01FB949A1F1EEAB4BC95F72C04283CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit][v2] Always close profiler output file. 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 Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This is a multi-part message in MIME format. --------------JocDeElx4978qmh37bnQgg20 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 05.03.2025 17:58, Sergey Kaplun wrote: > Hi, Sergey! > Thanks for adding the testcases! > LGTM with a last comment below. > >> + >> +local function close_profile_dump_with_0_samples_with_unload(subtest) >> + local jit_p = require('jit.p') >> + >> +subtest:plan(1) >> + >> + collectgarbage('stop') >> + jit_p.start(jit_p_options, filename) >> + jit_p.stop() >> + >> + -- Unload the module and clean the local. >> + package.loaded['jit.p'] = nil >> + jit_p = nil -- luacheck: no unused >> + collectgarbage('collect') >> + >> + local f = io.open(filename, 'r') >> + local p_content =f:read('a*') >> +subtest:is(p_content, '[No samples collected]\n', >> + 'profile dump has no samples') >> + f.close() > Typo: s/f./f:/ Thanks! --- a/test/tarantool-tests/lj-1304-close-profile-dump-with-0-samples.test.lua +++ b/test/tarantool-tests/lj-1304-close-profile-dump-with-0-samples.test.lua @@ -51,7 +51,7 @@ local function close_profile_dump_with_0_samples_with_unload(subtest)    local p_content = f:read('a*') subtest:is(p_content, '[No samples collected]\n',               'profile dump has no samples') -  f.close() + f:close()    -- Teardown.    collectgarbage('restart') --------------JocDeElx4978qmh37bnQgg20 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit


On 05.03.2025 17:58, Sergey Kaplun wrote:
Hi, Sergey!
Thanks for adding the testcases!
LGTM with a last comment below.

+
+local function close_profile_dump_with_0_samples_with_unload(subtest)
+  local jit_p = require('jit.p')
+
+  subtest:plan(1)
+
+  collectgarbage('stop')
+  jit_p.start(jit_p_options, filename)
+  jit_p.stop()
+
+  -- Unload the module and clean the local.
+  package.loaded['jit.p'] = nil
+  jit_p = nil -- luacheck: no unused
+  collectgarbage('collect')
+
+  local f = io.open(filename, 'r')
+  local p_content = f:read('a*')
+  subtest:is(p_content, '[No samples collected]\n',
+             'profile dump has no samples')
+  f.close()
Typo: s/f./f:/

Thanks!


--- a/test/tarantool-tests/lj-1304-close-profile-dump-with-0-samples.test.lua
+++ b/test/tarantool-tests/lj-1304-close-profile-dump-with-0-samples.test.lua
@@ -51,7 +51,7 @@ local function close_profile_dump_with_0_samples_with_unload(subtest)
   local p_content = f:read('a*')
   subtest:is(p_content, '[No samples collected]\n',
              'profile dump has no samples')
-  f.close()
f:close()
 
   -- Teardown.
   collectgarbage('restart')


    
--------------JocDeElx4978qmh37bnQgg20--