Skip to content

Commit a8e8bb3

Browse files
test: fix enabling dev_checks
Before this patch, running all test suites resulted in running them with dev_checks disabled since performance tests disabled the globally on require (and never enabled them back).
1 parent 57bcf8d commit a8e8bb3

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

test/performance/perf_test.lua

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ local t = require('luatest')
1010
local g = t.group('perf')
1111

1212
local helpers = require('test.helper')
13-
helpers.disable_dev_checks()
1413

1514

1615
local id = 0
@@ -24,6 +23,15 @@ local function reset_gen()
2423
end
2524

2625
g.before_all(function(g)
26+
-- Run real perf tests only with flag, otherwise run short version
27+
-- to test compatibility as part of unit/integration test run.
28+
g.perf_mode_on = os.getenv('PERF_MODE_ON')
29+
30+
if g.perf_mode_on then
31+
g.old_dev_checks_value = os.getenv('TARANTOOL_CRUD_ENABLE_INTERNAL_CHECKS')
32+
helpers.disable_dev_checks()
33+
end
34+
2735
g.cluster = helpers.Cluster:new({
2836
datadir = fio.tempdir(),
2937
server_command = helpers.entrypoint('srv_ddl'),
@@ -74,10 +82,6 @@ g.before_all(function(g)
7482
rawset(_G, 'crud', require('crud'))
7583
]])
7684

77-
-- Run real perf tests only with flag, otherwise run short version
78-
-- to test compatibility as part of unit/integration test run.
79-
g.perf_mode_on = os.getenv('PERF_MODE_ON')
80-
8185
g.total_report = {}
8286
end)
8387

@@ -301,6 +305,10 @@ g.after_all(function(g)
301305
row_name.insert_many,
302306
},
303307
})
308+
309+
if g.perf_mode_on then
310+
os.setenv('TARANTOOL_CRUD_ENABLE_INTERNAL_CHECKS', g.old_dev_checks_value)
311+
end
304312
end)
305313

306314
local function generate_customer()

0 commit comments

Comments
 (0)