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 2F6DAF138A2; Sat, 28 Sep 2024 13:38:21 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2F6DAF138A2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1727519901; bh=kUkFLjbAC/Od5SkrhsT/4ZfmGf9rGgFEuX7f29+X5+0=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=uhKWTyeytC8L4yi5NgdifCLxMQmtn0/JG1CcGH5ZemowvEQX21gm7gjU8MbhkJo9w TEQHPmi2pG8jK0CSTN2Vej059KQg0d8Gp0xbRNP+UVb7eWmPmkL61C5uM/7FAVwZDx LjFSmXuHomyT051lCDg9LmdrN1Lve93ym47hCfcg= Received: from smtp36.i.mail.ru (smtp36.i.mail.ru [95.163.41.77]) (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 1587BF13880 for ; Sat, 28 Sep 2024 13:38:19 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 1587BF13880 Received: by exim-smtp-6cc7dc5d5d-cbhld with esmtpa (envelope-from ) id 1suUqA-00000000Pdb-0C3I; Sat, 28 Sep 2024 13:38:18 +0300 To: Maxim Kokryashkin , Sergey Bronnikov Date: Sat, 28 Sep 2024 13:33:59 +0300 Message-ID: <20240928103359.16057-1-skaplun@tarantool.org> X-Mailer: git-send-email 2.46.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9DAB2B8462BE9AFBA4D5291F4EA823EE19303DC0B1C38641E182A05F538085040C2146B8155EF56973DE06ABAFEAF67053D11A42F52A0DF8E7DAFCAE3B8ACF47194981B86E6AE2D10 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE741223A1F87278638EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006376C2B935BE6E4DEC88638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D817F38C96547A096CF2958C7D27D6D7FEF1F0CA6A956C69E9CC7F00164DA146DAFE8445B8C89999728AA50765F7900637BA939FD1B3BAB99B389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8C2B5EEE3591E0D35F6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8BB662CFBDBA8F60F475ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A5251333CAA9C54FD75002B1117B3ED6961A87DC2871E6D454A13BD6A4B0E00B96823CB91A9FED034534781492E4B8EEADF12279BA039A6965C79554A2A72441328621D336A7BC284946AD531847A6065A535571D14F44ED41 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF77DD89D51EBB7742D3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF226291AC1553B21DD2DEBD857A940993C672B0ED6C4EB405CA590EFF7F0F9A6566DF14FFBF4EC71440DD0128EBC65B5491D4BD24A247FCD2F1CE3D4D8CCE999541BF98D6BEBFC7FCC226CC413062362A913E6812662D5F2A5EAB5682573093F7837F15F2B5E4A70B33F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj/D1U7K8gf+XDpXFBQG8I3Q== X-DA7885C5: 51A2FC567148C383F255D290C0D534F91C91071618301F18786F51B0A97BBF1D102C35A0F33C8BE35B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393C6D0B12EA33CAA9BF683A06BD24B218F16B0AE2C533AA906C44DB465A6EC845DE49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: [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 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" 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) -- 2.46.2