Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH luajit] test: fix misclib-getmetrics-lapi.test.lua
@ 2024-09-28 10:33 Sergey Kaplun via Tarantool-patches
  2024-10-01  9:42 ` Sergey Bronnikov via Tarantool-patches
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-09-28 10:33 UTC (permalink / raw)
  To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Tarantool-patches] [PATCH luajit] test: fix misclib-getmetrics-lapi.test.lua
  2024-09-28 10:33 [Tarantool-patches] [PATCH luajit] test: fix misclib-getmetrics-lapi.test.lua Sergey Kaplun via Tarantool-patches
@ 2024-10-01  9:42 ` Sergey Bronnikov via Tarantool-patches
  2024-10-11 18:51 ` Maxim Kokryashkin via Tarantool-patches
  2024-10-18 15:19 ` Sergey Kaplun via Tarantool-patches
  2 siblings, 0 replies; 5+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-10-01  9:42 UTC (permalink / raw)
  To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches

[-- Attachment #1: Type: text/plain, Size: 2642 bytes --]

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)

[-- Attachment #2: Type: text/html, Size: 3124 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Tarantool-patches] [PATCH luajit] test: fix misclib-getmetrics-lapi.test.lua
  2024-09-28 10:33 [Tarantool-patches] [PATCH luajit] test: fix misclib-getmetrics-lapi.test.lua Sergey Kaplun via Tarantool-patches
  2024-10-01  9:42 ` Sergey Bronnikov via Tarantool-patches
@ 2024-10-11 18:51 ` Maxim Kokryashkin via Tarantool-patches
  2024-10-15  7:40   ` Sergey Kaplun via Tarantool-patches
  2024-10-18 15:19 ` Sergey Kaplun via Tarantool-patches
  2 siblings, 1 reply; 5+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-10-11 18:51 UTC (permalink / raw)
  To: Sergey Kaplun; +Cc: tarantool-patches

Hi, Sergey!
Thanks for the patch!
LGTM, except for a single nit regarding the commit message:

On Sat, Sep 28, 2024 at 01:33:59PM GMT, 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.
> ---

IMO, it would be more readable to paraphrase like:
| When executed in Tarantool, the test might fail if Tarantool has
| already completed certain finalization steps. This patch
| addresses the issue by making the test more adaptable.

<snipped>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Tarantool-patches] [PATCH luajit] test: fix misclib-getmetrics-lapi.test.lua
  2024-10-11 18:51 ` Maxim Kokryashkin via Tarantool-patches
@ 2024-10-15  7:40   ` Sergey Kaplun via Tarantool-patches
  0 siblings, 0 replies; 5+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-10-15  7:40 UTC (permalink / raw)
  To: Maxim Kokryashkin; +Cc: tarantool-patches

Hi, Maxim!
Thanks for the review!
I fixed your comment, rebased branch to the current master, and
force-pushed it.

On 11.10.24, Maxim Kokryashkin wrote:
> Hi, Sergey!
> Thanks for the patch!
> LGTM, except for a single nit regarding the commit message:
> 
> On Sat, Sep 28, 2024 at 01:33:59PM GMT, 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.
> > ---
> 
> IMO, it would be more readable to paraphrase like:
> | When executed in Tarantool, the test might fail if Tarantool has
> | already completed certain finalization steps. This patch
> | addresses the issue by making the test more adaptable.
> 
> <snipped>

-- 
Best regards,
Sergey Kaplun

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Tarantool-patches] [PATCH luajit] test: fix misclib-getmetrics-lapi.test.lua
  2024-09-28 10:33 [Tarantool-patches] [PATCH luajit] test: fix misclib-getmetrics-lapi.test.lua Sergey Kaplun via Tarantool-patches
  2024-10-01  9:42 ` Sergey Bronnikov via Tarantool-patches
  2024-10-11 18:51 ` Maxim Kokryashkin via Tarantool-patches
@ 2024-10-18 15:19 ` Sergey Kaplun via Tarantool-patches
  2 siblings, 0 replies; 5+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-10-18 15:19 UTC (permalink / raw)
  To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches

I've applied the patch into all long-term branches in tarantool/luajit
and bumped a new version in master [1], release/3.2 [2] and
release/2.11 [3].

[1]: https://github.com/tarantool/tarantool/pull/10712
[2]: https://github.com/tarantool/tarantool/pull/10713
[3]: https://github.com/tarantool/tarantool/pull/10714

-- 
Best regards,
Sergey Kaplun

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-10-18 15:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-28 10:33 [Tarantool-patches] [PATCH luajit] test: fix misclib-getmetrics-lapi.test.lua Sergey Kaplun via Tarantool-patches
2024-10-01  9:42 ` Sergey Bronnikov via Tarantool-patches
2024-10-11 18:51 ` Maxim Kokryashkin via Tarantool-patches
2024-10-15  7:40   ` Sergey Kaplun via Tarantool-patches
2024-10-18 15:19 ` Sergey Kaplun via Tarantool-patches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox