[Tarantool-patches] [PATCH luajit][v2] Always close profiler output file.

Sergey Kaplun skaplun at tarantool.org
Wed Mar 5 17:58:36 MSK 2025


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:/

-- 
Best regards,
Sergey Kaplun


More information about the Tarantool-patches mailing list