[Tarantool-patches] [PATCH luajit 2/4] test: add skipcond on architectures for memprof
Sergey Kaplun
skaplun at tarantool.org
Fri Jun 4 16:37:19 MSK 2021
Hi!
Thanks for the review!
On 02.06.21, Sergey Ostanevich wrote:
> Hi!
>
> Thanks for the patch!
> Just one fixup is needed.
>
> Sergos
>
> > On 24 May 2021, at 16:27, Sergey Kaplun <skaplun at tarantool.org> wrote:
> >
> > Memprof's tests fail for architectures different from x86 and x64,
> > because memprof is not yet implemented for them.
> >
> > This patch adds skip condition to corresponding test.
> > ---
> > test/tarantool-tests/misclib-memprof-lapi.test.lua | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/test/tarantool-tests/misclib-memprof-lapi.test.lua b/test/tarantool-tests/misclib-memprof-lapi.test.lua
> > index b4d66509..4df9cfd8 100644
> > --- a/test/tarantool-tests/misclib-memprof-lapi.test.lua
> > +++ b/test/tarantool-tests/misclib-memprof-lapi.test.lua
> > @@ -1,3 +1,9 @@
> > +-- Memprof is implemented only for x86 and x64 architectures.
> ^^^^ ——> ^
> > +require("utils").skipcond(
> > + jit.arch ~= "x86" or jit.arch ~= "x64",
>
> I believe you overcomplicated the condition so it’ll skip even for
> mentioned archs
>
> tarantool> x='x86'
> ---
> ...
>
> tarantool> x~='x86' or x~='x64'
> ---
> - true
> ...
>
Thanks, nice catch!
Fixed.
Branch is force-pushed.
===================================================================
diff --git a/test/tarantool-tests/misclib-memprof-lapi.test.lua b/test/tarantool-tests/misclib-memprof-lapi.test.lua
index 4df9cfd8..96beb680 100644
--- a/test/tarantool-tests/misclib-memprof-lapi.test.lua
+++ b/test/tarantool-tests/misclib-memprof-lapi.test.lua
@@ -1,6 +1,6 @@
--- Memprof is implemented only for x86 and x64 architectures.
+-- Memprof is implemented for only x86 and x64 architectures.
require("utils").skipcond(
- jit.arch ~= "x86" or jit.arch ~= "x64",
+ jit.arch ~= "x86" and jit.arch ~= "x64",
jit.arch.." architecture is NIY for memprof"
)
@@ -131,9 +131,9 @@ local free = fill_ev_type(events, symbols, "free")
-- the number of allocations.
-- 1 event - alocation of table by itself + 1 allocation
-- of array part as far it is bigger than LJ_MAX_COLOSIZE (16).
-test:ok(check_alloc_report(alloc, 21, 19, 2))
+test:ok(check_alloc_report(alloc, 27, 25, 2))
-- 100 strings allocations.
-test:ok(check_alloc_report(alloc, 26, 19, 100))
+test:ok(check_alloc_report(alloc, 32, 25, 100))
-- Collect all previous allocated objects.
test:ok(free.INTERNAL.num == 102)
@@ -141,8 +141,8 @@ test:ok(free.INTERNAL.num == 102)
-- Tests for leak-only option.
-- See also https://github.com/tarantool/tarantool/issues/5812.
local heap_delta = process.form_heap_delta(events, symbols)
-local tab_alloc_stats = heap_delta[form_source_line(21)]
-local str_alloc_stats = heap_delta[form_source_line(26)]
+local tab_alloc_stats = heap_delta[form_source_line(27)]
+local str_alloc_stats = heap_delta[form_source_line(32)]
test:ok(tab_alloc_stats.nalloc == tab_alloc_stats.nfree)
test:ok(tab_alloc_stats.dbytes == 0)
test:ok(str_alloc_stats.nalloc == str_alloc_stats.nfree)
===================================================================
>
>
> > + jit.arch.." architecture is NIY for memprof"
> > +)
> > +
> > local tap = require("tap")
> >
> > local test = tap.test("misc-memprof-lapi")
> > --
> > 2.31.0
> >
>
--
Best regards,
Sergey Kaplun
More information about the Tarantool-patches
mailing list