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 3159DCE25EB; Tue, 1 Oct 2024 12:42:30 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3159DCE25EB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1727775750; bh=bxWnm1DymPiwVQvadlKirgSo3/JbAO7KV+vTsy8rKLg=; 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=XEJYZ2rF02FJ1BVZJhbG6PPrpDQStIAVHvOhMUDzZqxeIqlbA3xEouRvVLnta2vZA yMNQnm962FeFp7gKpolU2SP0OX7hh67yRD+t886NRuMDKSZMAvx3agHyjo3qG6pmkx g+PvHJec7OmSXJ2wn9TWPZp8KJZVMttkjb9EXIhQ= Received: from smtp32.i.mail.ru (smtp32.i.mail.ru [95.163.41.73]) (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 2FAC1CE25EB for ; Tue, 1 Oct 2024 12:42:28 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2FAC1CE25EB Received: by exim-smtp-867595fff-z46l5 with esmtpa (envelope-from ) id 1svZOl-00000000SMr-0LUE; Tue, 01 Oct 2024 12:42:27 +0300 Content-Type: multipart/alternative; boundary="------------EtwZmQMl8yrDdQ1R2h7apoRQ" Message-ID: <496948be-acd5-49d2-aa43-2673b8cdb3c2@tarantool.org> Date: Tue, 1 Oct 2024 12:42:26 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Sergey Kaplun , Maxim Kokryashkin Cc: tarantool-patches@dev.tarantool.org References: <20240928103359.16057-1-skaplun@tarantool.org> Content-Language: en-US In-Reply-To: <20240928103359.16057-1-skaplun@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD964E86F54238FCC39944EEDACCFDB27FB6E62F68F90DC1A7C182A05F5380850401934875B379DC8903DE06ABAFEAF67052428B50D74B8AB90C0F909D9500D6134B7464F346B62472A X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE73F36FF9A9461E0E9EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637C4BA093C789515AA8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8F348BC1DF857F9B61BF0C38C6CBE0EB3C4CD948C49D790DDCC7F00164DA146DAFE8445B8C89999728AA50765F7900637F6B57BC7E64490618DEB871D839B7333395957E7521B51C2DFABB839C843B9C08941B15DA834481F8AA50765F79006372A3B24BF85B2E607389733CBF5DBD5E9B5C8C57E37DE458BD9DD9810294C998ED8FC6C240DEA76428AA50765F79006377A3D351263067269D81D268191BDAD3DBD4B6F7A4D31EC0BE2F48590F00D11D6D81D268191BDAD3D78DA827A17800CE70BF5B1DCBE8F7AD3EC76A7562686271ED91E3A1F190DE8FD2E808ACE2090B5E14AD6D5ED66289B5278DA827A17800CE7A03E8F3C2D3812562EB15956EA79C166176DF2183F8FC7C0444A83B712AC0148725E5C173C3A84C3E83E68DE7309FD8D35872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: 0D63561A33F958A568CDEE4C72F1B88F5002B1117B3ED6964CF3A3DA9485D678E772F934B9BCD185823CB91A9FED034534781492E4B8EEADD0953842B444AAC3BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF4E5A8A4B12CC8155F104A6C89DD655D7BB68A270AC00CB9F7B5F89761DEFF6CF80A302719471681BA06F21331F7F71AFEADFBC0E5E364908DC2F207630C3C447092500080FF290B05F4332CA8FE04980913E6812662D5F2AB9AF64DB4688768036DF5FE9C0001AF333F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojNqGc3Zc5qMlcFCuqKI453g== X-Mailru-Sender: C4F68CFF4024C8867DFDF7C7F2588458188D44DB0A2CB33ACFE9FA76EDA5B4B78917C36ACD35CD6A3CB691084787515A645D15D82EE4B272BD6E4642A116CA93524AA66B5ACBE6721EF430B9A63E2A504198E0F3ECE9B5443453F38A29522196 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] test: fix misclib-getmetrics-lapi.test.lua 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. --------------EtwZmQMl8yrDdQ1R2h7apoRQ Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, Sergey, thanks for the patch! LGTM On 28.09.2024 13:33, Sergey Kaplun wrote: > When run under Tarantool, the test may fail if Tarantool already has > performed some finalize steps. This patch fixes it by making the test > more general. > --- > > Branch:https://github.com/tarantool/luajit/tree/skaplun/fix-getmetrics-lapi-test > > test/tarantool-tests/misclib-getmetrics-lapi.test.lua | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/test/tarantool-tests/misclib-getmetrics-lapi.test.lua b/test/tarantool-tests/misclib-getmetrics-lapi.test.lua > index 741900b6..89aecf7b 100644 > --- a/test/tarantool-tests/misclib-getmetrics-lapi.test.lua > +++ b/test/tarantool-tests/misclib-getmetrics-lapi.test.lua > @@ -132,8 +132,9 @@ test:test("gc-steps", function(subtest) > subtest:ok(oldm.gc_steps_atomic > 0) > subtest:ok(oldm.gc_steps_sweepstring > 0) > subtest:ok(oldm.gc_steps_sweep > 0) > - -- Nothing to finalize, skipped. > - subtest:is(oldm.gc_steps_finalize, 0) > + -- Nothing to finalize, skipped. Tarantool may perform some > + -- finalize steps already, so just use the base test. > + subtest:ok(oldm.gc_steps_finalize >= 0) > > -- As long as we stopped the GC, consequent call > -- should return the same values: > @@ -144,7 +145,7 @@ test:test("gc-steps", function(subtest) > subtest:is(newm.gc_steps_sweepstring - oldm.gc_steps_sweepstring, 0) > subtest:is(newm.gc_steps_sweep - oldm.gc_steps_sweep, 0) > -- Nothing to finalize, skipped. > - subtest:is(newm.gc_steps_finalize, 0) > + subtest:is(newm.gc_steps_finalize - oldm.gc_steps_finalize, 0) > oldm = newm > > -- Now the last phase: run full GC once and make sure that > @@ -158,7 +159,7 @@ test:test("gc-steps", function(subtest) > subtest:ok(newm.gc_steps_sweepstring - oldm.gc_steps_sweepstring >= 1) > subtest:ok(newm.gc_steps_sweep - oldm.gc_steps_sweep >= 1) > -- Nothing to finalize, skipped. > - subtest:is(newm.gc_steps_finalize, 0) > + subtest:is(newm.gc_steps_finalize - oldm.gc_steps_finalize, 0) > oldm = newm > > -- Now let's run three GC cycles to ensure that increment > @@ -174,7 +175,7 @@ test:test("gc-steps", function(subtest) > subtest:ok(newm.gc_steps_sweepstring - oldm.gc_steps_sweepstring >= 3) > subtest:ok(newm.gc_steps_sweep - oldm.gc_steps_sweep >= 3) > -- Nothing to finalize, skipped. > - subtest:is(newm.gc_steps_finalize, 0) > + subtest:is(newm.gc_steps_finalize - oldm.gc_steps_finalize, 0) > end) > > test:test("objcount", function(subtest) --------------EtwZmQMl8yrDdQ1R2h7apoRQ Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Hi, Sergey,

thanks for the patch! LGTM

On 28.09.2024 13:33, Sergey Kaplun wrote:
When run under Tarantool, the test may fail if Tarantool already has
performed some finalize steps. This patch fixes it by making the test
more general.
---

Branch: https://github.com/tarantool/luajit/tree/skaplun/fix-getmetrics-lapi-test

 test/tarantool-tests/misclib-getmetrics-lapi.test.lua | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/test/tarantool-tests/misclib-getmetrics-lapi.test.lua b/test/tarantool-tests/misclib-getmetrics-lapi.test.lua
index 741900b6..89aecf7b 100644
--- a/test/tarantool-tests/misclib-getmetrics-lapi.test.lua
+++ b/test/tarantool-tests/misclib-getmetrics-lapi.test.lua
@@ -132,8 +132,9 @@ test:test("gc-steps", function(subtest)
     subtest:ok(oldm.gc_steps_atomic > 0)
     subtest:ok(oldm.gc_steps_sweepstring > 0)
     subtest:ok(oldm.gc_steps_sweep > 0)
-    -- Nothing to finalize, skipped.
-    subtest:is(oldm.gc_steps_finalize, 0)
+    -- Nothing to finalize, skipped. Tarantool may perform some
+    -- finalize steps already, so just use the base test.
+    subtest:ok(oldm.gc_steps_finalize >= 0)
 
     -- As long as we stopped the GC, consequent call
     -- should return the same values:
@@ -144,7 +145,7 @@ test:test("gc-steps", function(subtest)
     subtest:is(newm.gc_steps_sweepstring - oldm.gc_steps_sweepstring, 0)
     subtest:is(newm.gc_steps_sweep - oldm.gc_steps_sweep, 0)
     -- Nothing to finalize, skipped.
-    subtest:is(newm.gc_steps_finalize, 0)
+    subtest:is(newm.gc_steps_finalize - oldm.gc_steps_finalize, 0)
     oldm = newm
 
     -- Now the last phase: run full GC once and make sure that
@@ -158,7 +159,7 @@ test:test("gc-steps", function(subtest)
     subtest:ok(newm.gc_steps_sweepstring - oldm.gc_steps_sweepstring >= 1)
     subtest:ok(newm.gc_steps_sweep  - oldm.gc_steps_sweep >= 1)
     -- Nothing to finalize, skipped.
-    subtest:is(newm.gc_steps_finalize, 0)
+    subtest:is(newm.gc_steps_finalize - oldm.gc_steps_finalize, 0)
     oldm = newm
 
     -- Now let's run three GC cycles to ensure that increment
@@ -174,7 +175,7 @@ test:test("gc-steps", function(subtest)
     subtest:ok(newm.gc_steps_sweepstring - oldm.gc_steps_sweepstring >= 3)
     subtest:ok(newm.gc_steps_sweep  - oldm.gc_steps_sweep >= 3)
     -- Nothing to finalize, skipped.
-    subtest:is(newm.gc_steps_finalize, 0)
+    subtest:is(newm.gc_steps_finalize - oldm.gc_steps_finalize, 0)
 end)
 
 test:test("objcount", function(subtest)
--------------EtwZmQMl8yrDdQ1R2h7apoRQ--