Skip to content

Commit

Permalink
test: fix flaky <unit-jit-parse.test.lua>
Browse files Browse the repository at this point in the history
This commit is the follow-up for
5570eb8 ("test: add utility for parsing
`jit.dump`")

This test is flaky on GC64 build due to some unpredictable JIT
compilation hotcount and trace recording.

This patch adds `jit.off()`/`jit.on()` calls to be sure that the JIT is
enabled only for the particular part of the test, where we collect the
trace dump.

Reviewed-by: Igor Munkin <imun@tarantool.org>
Signed-off-by: Igor Munkin <imun@tarantool.org>
  • Loading branch information
Buristan authored and igormunkin committed Jul 4, 2023
1 parent 7fa0037 commit 8e46d60
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test/tarantool-tests/unit-jit-parse.test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ local test = tap.test('unit-jit-parse'):skipcond({

local jparse = require('utils').jit.parse

-- XXX: Avoid any other traces compilation due to hotcount
-- collisions for predictable results.
jit.off()
jit.flush()

local expected_irs = {
-- The different exotic builds may add different IR
-- instructions, so just check some IR-s existence.
Expand All @@ -19,15 +24,16 @@ jit.opt.start('hotloop=1')

test:plan(N_TESTS)

-- Reset traces.
jit.flush()

jit.on()
jparse.start('i')

-- Loop to compile:
for _ = 1, 3 do end

local traces = jparse.finish()

jit.off()

local loop_trace = traces[1]

for irnum = 1, N_TESTS do
Expand Down

0 comments on commit 8e46d60

Please sign in to comment.