<HTML><BODY><p><span class="js-issue-title">test: switched on pretest_clean routine</span><span class="gh-header-number"><br><br></span>Switched on pretest_clean routine which helps to cleanup<br> the test environment before test start. Also moved the global<br> functions in box suite into the test_helpers module, to make<br> it possible to use it in each of the test while global functions<br> are removing with pretest_clean routine.<br><br>---<br>Github pull request: <a href="https://github.com/tarantool/tarantool/pull/4029">https://github.com/tarantool/tarantool/pull/4029</a> </p><p>Travis-CI: <a href="https://travis-ci.org/tarantool/tarantool/builds/502431423">https://travis-ci.org/tarantool/tarantool/builds/502431423</a> </p><p><br>From acbd981d79fe7b2ad5cdf5c2c1e9c1d3613d89c9 Mon Sep 17 00:00:00 2001<br>From: "Alexander V. Tikhonov" <avtikhon@tarantool.org><br>Date: Wed, 6 Mar 2019 10:17:47 +0300<br>Subject: [PATCH] test: switched on pretest_clean routine<br><br>Switched on pretest_clean routine which helps to cleanup<br>the test environment before test start. Also moved the global<br>functions in box suite into the test_helpers module, to make<br>it possible to use it in each of the test while global functions<br>are removing with pretest_clean routine.<br>---<br> test/app-tap/suite.ini                        |  1 +<br> test/app/suite.ini                            |  1 +<br> test/box-py/suite.ini                         |  1 +<br> test/box-tap/suite.ini                        |  1 +<br> test/box/admin.result                         |  5 +-<br> test/box/admin.test.lua                       |  3 +-<br> test/box/box.lua                              | 29 -----------<br> test/box/cfg.result                           |  7 ++-<br> test/box/cfg.test.lua                         |  6 ++-<br> test/box/lua/test_helpers.lua                 | 32 ++++++++++++<br> test/box/sql.result                           | 50 +++++++++++--------<br> test/box/sql.test.lua                         | 46 +++++++++--------<br> test/box/suite.ini                            |  3 +-<br> test/engine/suite.ini                         |  1 +<br> test/engine_long/delete_insert.result         |  5 +-<br> test/engine_long/delete_insert.test.lua       |  5 +-<br> test/engine_long/delete_replace_update.result | 13 +++--<br> .../delete_replace_update.test.lua            | 12 +++--<br> test/engine_long/suite.ini                    |  1 +<br> test/engine_long/suite.lua                    |  7 ++-<br> test/long_run-py/suite.ini                    |  1 +<br> test/luajit-tap/suite.ini                     |  1 +<br> test/replication-py/suite.ini                 |  1 +<br> test/replication/suite.ini                    |  1 +<br> test/sql-tap/suite.ini                        |  1 +<br> test/sql/suite.ini                            |  1 +<br> test/unit/suite.ini                           |  1 +<br> test/vinyl/suite.ini                          |  1 +<br> test/wal_off/suite.ini                        |  1 +<br> test/xlog-py/suite.ini                        |  1 +<br> test/xlog/suite.ini                           |  1 +<br> 31 files changed, 146 insertions(+), 94 deletions(-)<br> create mode 100644 test/box/lua/test_helpers.lua<br><br>diff --git a/test/app-tap/suite.ini b/test/app-tap/suite.ini<br>index 86af82637..9629dfad5 100644<br>--- a/test/app-tap/suite.ini<br>+++ b/test/app-tap/suite.ini<br>@@ -3,3 +3,4 @@ core = app<br> description = application server tests (TAP)<br> lua_libs = lua/require_mod.lua lua/serializer_test.lua<br> is_parallel = True<br>+pretest_clean = True<br>diff --git a/test/app/suite.ini b/test/app/suite.ini<br>index 7f3c0a8f5..4f9e51550 100644<br>--- a/test/app/suite.ini<br>+++ b/test/app/suite.ini<br>@@ -5,3 +5,4 @@ script = app.lua<br> lua_libs = lua/fiber.lua<br> use_unix_sockets = True<br> is_parallel = True<br>+pretest_clean = True<br>diff --git a/test/box-py/suite.ini b/test/box-py/suite.ini<br>index d7d512b0d..cad0b0041 100644<br>--- a/test/box-py/suite.ini<br>+++ b/test/box-py/suite.ini<br>@@ -5,3 +5,4 @@ script = box.lua<br> lua_libs = lua/fiber.lua lua/fifo.lua<br> use_unix_sockets = True<br> is_parallel = False<br>+pretest_clean = True<br>diff --git a/test/box-tap/suite.ini b/test/box-tap/suite.ini<br>index 50dc1f435..b3ccf2e6f 100644<br>--- a/test/box-tap/suite.ini<br>+++ b/test/box-tap/suite.ini<br>@@ -2,3 +2,4 @@<br> core = app<br> description = Database tests with #! using TAP<br> is_parallel = True<br>+pretest_clean = True<br>diff --git a/test/box/admin.result b/test/box/admin.result<br>index e6fc1f302..cd5eb0c62 100644<br>--- a/test/box/admin.result<br>+++ b/test/box/admin.result<br>@@ -24,7 +24,10 @@ help()<br>       \help show this screen<br>       \quit quit interactive console<br> ...<br>-cfg_filter(box.cfg)<br>+test_helpers = require('test_helpers')<br>+---<br>+...<br>+test_helpers.cfg_filter(box.cfg)<br> ---<br> - - - background<br>     - false<br>diff --git a/test/box/admin.test.lua b/test/box/admin.test.lua<br>index 4e7a78f5b..353afea9c 100644<br>--- a/test/box/admin.test.lua<br>+++ b/test/box/admin.test.lua<br>@@ -6,7 +6,8 @@ space = box.schema.space.create('tweedledum')<br> index = space:create_index('primary')<br> <br> help()<br>-cfg_filter(box.cfg)<br>+test_helpers = require('test_helpers')<br>+test_helpers.cfg_filter(box.cfg)<br> space:insert{1, 'tuple'}<br> box.snapshot()<br> space:delete{1}<br>diff --git a/test/box/box.lua b/test/box/box.lua<br>index b3b10ffd4..dcd52284c 100644<br>--- a/test/box/box.lua<br>+++ b/test/box/box.lua<br>@@ -8,32 +8,3 @@ box.cfg{<br> }<br> <br> require('console').listen(os.getenv('ADMIN'))<br>-<br>-local _hide = {<br>-    pid_file=1, log=1, listen=1, vinyl_dir=1,<br>-    memtx_dir=1, wal_dir=1,<br>-    memtx_max_tuple_size=1, memtx_min_tuple_size=1<br>-}<br>-<br>-function cfg_filter(data)<br>-    if type(data)~='table' then return data end<br>-    local keys,k,_ = {}<br>-    for k in pairs(data) do<br>-        table.insert(keys, k)<br>-    end<br>-    table.sort(keys)<br>-    local result = {}<br>-    for _,k in pairs(keys) do<br>-        table.insert(result, {k, _hide[k] and '<hidden>' or cfg_filter(data[k])})<br>-    end<br>-    return result<br>-end<br>-<br>-function compare(a,b)<br>-    return a[1] < b[1]<br>-end<br>-<br>-function sorted(data)<br>-    table.sort(data, compare)<br>-    return data<br>-end<br>diff --git a/test/box/cfg.result b/test/box/cfg.result<br>index 7778f82ac..945372f41 100644<br>--- a/test/box/cfg.result<br>+++ b/test/box/cfg.result<br>@@ -1,3 +1,6 @@<br>+test_helpers = require('test_helpers')<br>+---<br>+...<br> env = require('test_run')<br> ---<br> ...<br>@@ -12,7 +15,7 @@ box.cfg.nosuchoption = 1<br> ---<br> - error: 'builtin/box/load_cfg.lua:<line>: Attempt to modify a read-only table'<br> ...<br>-cfg_filter(box.cfg)<br>+test_helpers.cfg_filter(box.cfg)<br> ---<br> - - - background<br>     - false<br>@@ -111,7 +114,7 @@ cfg_filter(box.cfg)<br> box.cfg()<br> ---<br> ...<br>-cfg_filter(box.cfg)<br>+test_helpers.cfg_filter(box.cfg)<br> ---<br> - - - background<br>     - false<br>diff --git a/test/box/cfg.test.lua b/test/box/cfg.test.lua<br>index a6416241f..3189b5c2c 100644<br>--- a/test/box/cfg.test.lua<br>+++ b/test/box/cfg.test.lua<br>@@ -1,11 +1,13 @@<br>+test_helpers = require('test_helpers')<br>+<br> env = require('test_run')<br> test_run = env.new()<br> test_run:cmd("push filter '(error: .*)\\.lua:[0-9]+: ' to '\\1.lua:<line>: '")<br> box.cfg.nosuchoption = 1<br>-cfg_filter(box.cfg)<br>+test_helpers.cfg_filter(box.cfg)<br> -- must be read-only<br> box.cfg()<br>-cfg_filter(box.cfg)<br>+test_helpers.cfg_filter(box.cfg)<br> <br> -- check that cfg with unexpected parameter fails.<br> box.cfg{sherlock = 'holmes'}<br>diff --git a/test/box/lua/test_helpers.lua b/test/box/lua/test_helpers.lua<br>new file mode 100644<br>index 000000000..bb231e73b<br>--- /dev/null<br>+++ b/test/box/lua/test_helpers.lua<br>@@ -0,0 +1,32 @@<br>+local test_helpers = {}<br>+<br>+local _hide = {<br>+    pid_file=1, log=1, listen=1, vinyl_dir=1,<br>+    memtx_dir=1, wal_dir=1,<br>+    memtx_max_tuple_size=1, memtx_min_tuple_size=1<br>+}<br>+<br>+function test_helpers.cfg_filter(data)<br>+    if type(data)~='table' then return data end<br>+    local keys,k,_ = {}<br>+    for k in pairs(data) do<br>+        table.insert(keys, k)<br>+    end<br>+    table.sort(keys)<br>+    local result = {}<br>+    for _,k in pairs(keys) do<br>+        table.insert(result, {k, _hide[k] and '<hidden>' or test_helpers.cfg_filter(data[k])})<br>+    end<br>+    return result<br>+end<br>+<br>+function compare(a,b)<br>+    return a[1] < b[1]<br>+end<br>+<br>+function test_helpers.sorted(data)<br>+    table.sort(data, compare)<br>+    return data<br>+end<br>+<br>+return test_helpers<br>diff --git a/test/box/sql.result b/test/box/sql.result<br>index 78dc47167..c10434986 100644<br>--- a/test/box/sql.result<br>+++ b/test/box/sql.result<br>@@ -227,6 +227,9 @@ space = nil<br> net_box = require('net.box')<br> ---<br> ...<br>+test_helpers = require('test_helpers')<br>+---<br>+...<br> -- Prepare spaces<br> box.schema.user.create('test', { password = 'test' })<br> ---<br>@@ -275,7 +278,7 @@ space:insert{'Kytes', 'Tomas'}<br> ---<br> - ['Kytes', 'Tomas']<br> ...<br>-sorted(space.index.secondary:select('Richard'))<br>+test_helpers.sorted(space.index.secondary:select('Richard'))<br> ---<br> - - ['Doe', 'Richard']<br>   - ['Roe', 'Richard']<br>@@ -284,7 +287,7 @@ sorted(space.index.secondary:select('Richard'))<br> -- A test case for Bug#729879<br> -- "Zero limit is treated the same as no limit"<br> -- https://bugs.launchpad.net/tarantool/+bug/729879<br>-sorted(space.index.secondary:select('Richard', { limit = 0 }))<br>+test_helpers.sorted(space.index.secondary:select('Richard', { limit = 0 }))<br> ---<br> - []<br> ...<br>@@ -301,7 +304,7 @@ space:insert{'Britney'}<br> ---<br> - error: Tuple field 2 required by space format is missing<br> ...<br>-sorted(space.index.secondary:select('Anything'))<br>+test_helpers.sorted(space.index.secondary:select('Anything'))<br> ---<br> - []<br> ...<br>@@ -309,7 +312,7 @@ space:insert{'Stephanie'}<br> ---<br> - error: Tuple field 2 required by space format is missing<br> ...<br>-sorted(space.index.secondary:select('Anything'))<br>+test_helpers.sorted(space.index.secondary:select('Anything'))<br> ---<br> - []<br> ...<br>@@ -321,11 +324,11 @@ space:select{'Spears'}<br> ---<br> - - ['Spears', 'Britney']<br> ...<br>-sorted(space.index.secondary:select('Anything'))<br>+test_helpers.sorted(space.index.secondary:select('Anything'))<br> ---<br> - []<br> ...<br>-sorted(space.index.secondary:select('Britney'))<br>+test_helpers.sorted(space.index.secondary:select('Britney'))<br> ---<br> - - ['Spears', 'Britney']<br> ...<br>@@ -385,7 +388,7 @@ space:select{'key3'}<br> ---<br> - - ['key3', 'part1', 'part2_b']<br> ...<br>-sorted(space.index.secondary:select('part1'))<br>+test_helpers.sorted(space.index.secondary:select('part1'))<br> ---<br> - - ['key1', 'part1', 'part2']<br>   - ['key2', 'part1', 'part2_a']<br>@@ -418,7 +421,7 @@ space:select{'key3'}<br> ---<br> - - ['key3', 'part1', 'part2_b']<br> ...<br>-sorted(space.index.secondary:select('part1'))<br>+test_helpers.sorted(space.index.secondary:select('part1'))<br> ---<br> - - ['key1', 'part1', 'part2']<br>   - ['key2', 'part1', 'part2_a']<br>@@ -492,33 +495,33 @@ space:select{21234567}<br> ---<br> - - [21234567, 'part1', 'part2_a']<br> ...<br>-sorted(space.index.secondary:select('part1'))<br>+test_helpers.sorted(space.index.secondary:select('part1'))<br> ---<br> - - [1234567, 'part1', 'part2']<br>   - [11234567, 'part1', 'part2']<br>   - [21234567, 'part1', 'part2_a']<br> ...<br>-sorted(space.index.secondary:select('part1_a'))<br>+test_helpers.sorted(space.index.secondary:select('part1_a'))<br> ---<br> - - [31234567, 'part1_a', 'part2']<br>   - [41234567, 'part1_a', 'part2_a']<br> ...<br>-sorted(space.index.secondary:select('part_none'))<br>+test_helpers.sorted(space.index.secondary:select('part_none'))<br> ---<br> - []<br> ...<br>-sorted(s.index[1]:select({'part1', 'part2'}))<br>+test_helpers.sorted(s.index[1]:select({'part1', 'part2'}))<br> ---<br> - - [1234567, 'part1', 'part2']<br>   - [11234567, 'part1', 'part2']<br> ...<br>-sorted(space.index.secondary:select('part1'))<br>+test_helpers.sorted(space.index.secondary:select('part1'))<br> ---<br> - - [1234567, 'part1', 'part2']<br>   - [11234567, 'part1', 'part2']<br>   - [21234567, 'part1', 'part2_a']<br> ...<br>-sorted(space.index.secondary:select('part2'))<br>+test_helpers.sorted(space.index.secondary:select('part2'))<br> ---<br> - []<br> ...<br>@@ -593,19 +596,22 @@ s = box.space.tweedledum<br> ---<br> ...<br> -- Bug#929654 - secondary hash index is not built with build_indexes()<br>-sorted(space.index.secondary:select('hello'))<br>+test_helpers = require('test_helpers')<br>+---<br>+...<br>+test_helpers.sorted(space.index.secondary:select('hello'))<br> ---<br> - - [1, 'hello']<br> ...<br>-sorted(space.index.secondary:select('brave'))<br>+test_helpers.sorted(space.index.secondary:select('brave'))<br> ---<br> - - [2, 'brave']<br> ...<br>-sorted(space.index.secondary:select('new'))<br>+test_helpers.sorted(space.index.secondary:select('new'))<br> ---<br> - - [3, 'new']<br> ...<br>-sorted(space.index.secondary:select('world'))<br>+test_helpers.sorted(space.index.secondary:select('world'))<br> ---<br> - - [4, 'world']<br> ...<br>@@ -629,7 +635,7 @@ space:select{'Spears'}<br> ---<br> - - ['Spears', 'Britney']<br> ...<br>-sorted(space.index.secondary:select('Britney'))<br>+test_helpers.sorted(space.index.secondary:select('Britney'))<br> ---<br> - - ['Spears', 'Britney']<br> ...<br>@@ -712,7 +718,7 @@ space:insert{15, 'duplicate three'}<br> ---<br> - [15, 'duplicate three']<br> ...<br>-sorted(space.index.secondary:select('duplicate one'))<br>+test_helpers.sorted(space.index.secondary:select('duplicate one'))<br> ---<br> - - [1, 'duplicate one']<br>   - [2, 'duplicate one']<br>@@ -720,7 +726,7 @@ sorted(space.index.secondary:select('duplicate one'))<br>   - [4, 'duplicate one']<br>   - [5, 'duplicate one']<br> ...<br>-sorted(space.index.secondary:select('duplicate two'))<br>+test_helpers.sorted(space.index.secondary:select('duplicate two'))<br> ---<br> - - [6, 'duplicate two']<br>   - [7, 'duplicate two']<br>@@ -728,7 +734,7 @@ sorted(space.index.secondary:select('duplicate two'))<br>   - [9, 'duplicate two']<br>   - [10, 'duplicate two']<br> ...<br>-sorted(space.index.secondary:select('duplicate three'))<br>+test_helpers.sorted(space.index.secondary:select('duplicate three'))<br> ---<br> - - [11, 'duplicate three']<br>   - [12, 'duplicate three']<br>diff --git a/test/box/sql.test.lua b/test/box/sql.test.lua<br>index 3d2a99b74..9db701142 100644<br>--- a/test/box/sql.test.lua<br>+++ b/test/box/sql.test.lua<br>@@ -90,6 +90,7 @@ box.space.test1:drop()<br> box.schema.user.drop('test')<br> space = nil<br> net_box = require('net.box')<br>+test_helpers = require('test_helpers')<br> <br> -- Prepare spaces<br> box.schema.user.create('test', { password = 'test' })<br>@@ -110,13 +111,13 @@ space:insert{'Roe', 'Richard'}<br> space:insert{'Woe', 'Richard'}<br> space:insert{'Major', 'Tomas'}<br> space:insert{'Kytes', 'Tomas'}<br>-sorted(space.index.secondary:select('Richard'))<br>+test_helpers.sorted(space.index.secondary:select('Richard'))<br> <br> <br> -- A test case for Bug#729879<br> -- "Zero limit is treated the same as no limit"<br> -- https://bugs.launchpad.net/tarantool/+bug/729879<br>-sorted(space.index.secondary:select('Richard', { limit = 0 }))<br>+test_helpers.sorted(space.index.secondary:select('Richard', { limit = 0 }))<br> s:truncate()<br> <br> <br>@@ -128,13 +129,13 @@ s:truncate()<br> -- get away with it.<br> <br> space:insert{'Britney'}<br>-sorted(space.index.secondary:select('Anything'))<br>+test_helpers.sorted(space.index.secondary:select('Anything'))<br> space:insert{'Stephanie'}<br>-sorted(space.index.secondary:select('Anything'))<br>+test_helpers.sorted(space.index.secondary:select('Anything'))<br> space:insert{'Spears', 'Britney'}<br> space:select{'Spears'}<br>-sorted(space.index.secondary:select('Anything'))<br>-sorted(space.index.secondary:select('Britney'))<br>+test_helpers.sorted(space.index.secondary:select('Anything'))<br>+test_helpers.sorted(space.index.secondary:select('Britney'))<br> <br> s.index[0]:select('Spears', { limit = 100, iterator = 'GE' })<br> s.index[1]:select('Britney', { limit = 100, iterator = 'GE' })<br>@@ -156,7 +157,7 @@ s.index[1]:select{}<br> space:select{'key1'}<br> space:select{'key2'}<br> space:select{'key3'}<br>-sorted(space.index.secondary:select('part1'))<br>+test_helpers.sorted(space.index.secondary:select('part1'))<br> <br> s.index[1]:select('part1', { limit = 100, iterator = 'GE' })<br> s.index[0]:select('key2', { limit = 100, iterator = 'GE' })<br>@@ -164,7 +165,7 @@ s.index[1]:select({ 'part1', 'part2_a' }, { limit = 1, iterator = 'GE' })<br> space:select{'key1'}<br> space:select{'key2'}<br> space:select{'key3'}<br>-sorted(space.index.secondary:select('part1'))<br>+test_helpers.sorted(space.index.secondary:select('part1'))<br> <br> space:delete('key1')<br> space:delete('key2')<br>@@ -188,14 +189,14 @@ l<br> space:select{1234567}<br> space:select{11234567}<br> space:select{21234567}<br>-sorted(space.index.secondary:select('part1'))<br>-sorted(space.index.secondary:select('part1_a'))<br>-sorted(space.index.secondary:select('part_none'))<br>+test_helpers.sorted(space.index.secondary:select('part1'))<br>+test_helpers.sorted(space.index.secondary:select('part1_a'))<br>+test_helpers.sorted(space.index.secondary:select('part_none'))<br> <br>-sorted(s.index[1]:select({'part1', 'part2'}))<br>+test_helpers.sorted(s.index[1]:select({'part1', 'part2'}))<br> <br>-sorted(space.index.secondary:select('part1'))<br>-sorted(space.index.secondary:select('part2'))<br>+test_helpers.sorted(space.index.secondary:select('part1'))<br>+test_helpers.sorted(space.index.secondary:select('part2'))<br> <br> -- cleanup<br> space:delete(1234567)<br>@@ -226,10 +227,11 @@ space = conn.space.tweedledum<br> s = box.space.tweedledum<br> <br> -- Bug#929654 - secondary hash index is not built with build_indexes()<br>-sorted(space.index.secondary:select('hello'))<br>-sorted(space.index.secondary:select('brave'))<br>-sorted(space.index.secondary:select('new'))<br>-sorted(space.index.secondary:select('world'))<br>+test_helpers = require('test_helpers')<br>+test_helpers.sorted(space.index.secondary:select('hello'))<br>+test_helpers.sorted(space.index.secondary:select('brave'))<br>+test_helpers.sorted(space.index.secondary:select('new'))<br>+test_helpers.sorted(space.index.secondary:select('world'))<br> s:truncate()<br> <br> -- A test case for: http://bugs.launchpad.net/bugs/735140<br>@@ -240,7 +242,7 @@ s.index.secondary:alter{type = 'tree', unique = false}<br> <br> space:insert{'Spears', 'Britney'}<br> space:select{'Spears'}<br>-sorted(space.index.secondary:select('Britney'))<br>+test_helpers.sorted(space.index.secondary:select('Britney'))<br> -- try to insert the incoplete tuple<br> space:replace{'Spears'}<br> -- check that nothing has been updated<br>@@ -268,9 +270,9 @@ space:insert{14, 'duplicate three'}<br> space:insert{15, 'duplicate three'}<br> <br> <br>-sorted(space.index.secondary:select('duplicate one'))<br>-sorted(space.index.secondary:select('duplicate two'))<br>-sorted(space.index.secondary:select('duplicate three'))<br>+test_helpers.sorted(space.index.secondary:select('duplicate one'))<br>+test_helpers.sorted(space.index.secondary:select('duplicate two'))<br>+test_helpers.sorted(space.index.secondary:select('duplicate three'))<br> <br> space:delete(1)<br> space:delete(2)<br>diff --git a/test/box/suite.ini b/test/box/suite.ini<br>index fee1c40b4..ee89dd64b 100644<br>--- a/test/box/suite.ini<br>+++ b/test/box/suite.ini<br>@@ -4,6 +4,7 @@ description = Database tests<br> script = box.lua<br> disabled = rtree_errinj.test.lua tuple_bench.test.lua<br> release_disabled = errinj.test.lua errinj_index.test.lua rtree_errinj.test.lua upsert_errinj.test.lua iproto_stress.test.lua<br>-lua_libs = lua/fifo.lua lua/utils.lua lua/bitset.lua lua/index_random_test.lua lua/push.lua lua/identifier.lua<br>+lua_libs = lua/test_helpers.lua lua/fifo.lua lua/utils.lua lua/bitset.lua lua/index_random_test.lua lua/push.lua lua/identifier.lua<br> use_unix_sockets = True<br> is_parallel = True<br>+pretest_clean = True<br>diff --git a/test/engine/suite.ini b/test/engine/suite.ini<br>index 3f82a1325..ddc4c04e9 100644<br>--- a/test/engine/suite.ini<br>+++ b/test/engine/suite.ini<br>@@ -7,3 +7,4 @@ config = engine.cfg<br> #disabled = replica_join.test.lua<br> lua_libs = conflict.lua ../box/lua/utils.lua ../box/lua/push.lua<br> is_parallel = True<br>+pretest_clean = True<br>diff --git a/test/engine_long/delete_insert.result b/test/engine_long/delete_insert.result<br>index b1d504271..2cc46486a 100644<br>--- a/test/engine_long/delete_insert.result<br>+++ b/test/engine_long/delete_insert.result<br>@@ -1,3 +1,6 @@<br>+el_mod = require("suite")<br>+---<br>+...<br> test_run = require('test_run')<br> ---<br> ...<br>@@ -13,7 +16,7 @@ iterations = 100000<br> math.randomseed(1)<br> ---<br> ...<br>-delete_insert(engine, iterations)<br>+el_mod.delete_insert(engine, iterations)<br> ---<br> - - 100000<br>   - IAKGPQANAOSLARIFIBKB<br>diff --git a/test/engine_long/delete_insert.test.lua b/test/engine_long/delete_insert.test.lua<br>index 275aaa23e..83119cf14 100644<br>--- a/test/engine_long/delete_insert.test.lua<br>+++ b/test/engine_long/delete_insert.test.lua<br>@@ -1,6 +1,9 @@<br>+el_mod = require("suite")<br>+<br> test_run = require('test_run')<br> inspector = test_run.new()<br> engine = inspector:get_cfg('engine')<br> iterations = 100000<br>+<br> math.randomseed(1)<br>-delete_insert(engine, iterations)<br>+el_mod.delete_insert(engine, iterations)<br>diff --git a/test/engine_long/delete_replace_update.result b/test/engine_long/delete_replace_update.result<br>index 66cb9c82c..b75091945 100644<br>--- a/test/engine_long/delete_replace_update.result<br>+++ b/test/engine_long/delete_replace_update.result<br>@@ -1,3 +1,6 @@<br>+el_mod = require("suite")<br>+---<br>+...<br> engine_name = 'memtx'<br> ---<br> ...<br>@@ -7,7 +10,7 @@ iterations = 100000<br> math.randomseed(1)<br> ---<br> ...<br>-delete_replace_update(engine_name, iterations)<br>+el_mod.delete_replace_update(engine_name, iterations)<br> ---<br> - - 100000<br>   - 3<br>@@ -17,7 +20,7 @@ delete_replace_update(engine_name, iterations)<br> math.randomseed(2)<br> ---<br> ...<br>-delete_replace_update(engine_name, iterations)<br>+el_mod.delete_replace_update(engine_name, iterations)<br> ---<br> - - 100000<br>   - 3<br>@@ -27,7 +30,7 @@ delete_replace_update(engine_name, iterations)<br> math.randomseed(3)<br> ---<br> ...<br>-delete_replace_update(engine_name, iterations)<br>+el_mod.delete_replace_update(engine_name, iterations)<br> ---<br> - - 100000<br>   - 1<br>@@ -37,7 +40,7 @@ delete_replace_update(engine_name, iterations)<br> math.randomseed(4)<br> ---<br> ...<br>-delete_replace_update(engine_name, iterations)<br>+el_mod.delete_replace_update(engine_name, iterations)<br> ---<br> - - 100000<br>   - 3<br>@@ -47,7 +50,7 @@ delete_replace_update(engine_name, iterations)<br> math.randomseed(5)<br> ---<br> ...<br>-delete_replace_update(engine_name, iterations)<br>+el_mod.delete_replace_update(engine_name, iterations)<br> ---<br> - - 100000<br>   - 3<br>diff --git a/test/engine_long/delete_replace_update.test.lua b/test/engine_long/delete_replace_update.test.lua<br>index 466b8f007..004597b15 100644<br>--- a/test/engine_long/delete_replace_update.test.lua<br>+++ b/test/engine_long/delete_replace_update.test.lua<br>@@ -1,17 +1,19 @@<br>+el_mod = require("suite")<br>+<br> engine_name = 'memtx'<br> iterations = 100000<br> <br> math.randomseed(1)<br>-delete_replace_update(engine_name, iterations)<br>+el_mod.delete_replace_update(engine_name, iterations)<br> <br> math.randomseed(2)<br>-delete_replace_update(engine_name, iterations)<br>+el_mod.delete_replace_update(engine_name, iterations)<br> <br> math.randomseed(3)<br>-delete_replace_update(engine_name, iterations)<br>+el_mod.delete_replace_update(engine_name, iterations)<br> <br> math.randomseed(4)<br>-delete_replace_update(engine_name, iterations)<br>+el_mod.delete_replace_update(engine_name, iterations)<br> <br> math.randomseed(5)<br>-delete_replace_update(engine_name, iterations)<br>+el_mod.delete_replace_update(engine_name, iterations)<br>diff --git a/test/engine_long/suite.ini b/test/engine_long/suite.ini<br>index a46c9535f..ff12f0b50 100644<br>--- a/test/engine_long/suite.ini<br>+++ b/test/engine_long/suite.ini<br>@@ -7,3 +7,4 @@ lua_libs = suite.lua<br> use_unix_sockets = True<br> config = engine.cfg<br> is_parallel = False<br>+pretest_clean = True<br>diff --git a/test/engine_long/suite.lua b/test/engine_long/suite.lua<br>index 464138db1..4db885031 100644<br>--- a/test/engine_long/suite.lua<br>+++ b/test/engine_long/suite.lua<br>@@ -1,3 +1,4 @@<br>+local engine_long_module = {}<br> <br> function string_function()<br>     local random_number<br>@@ -10,7 +11,7 @@ function string_function()<br>     return random_string<br> end<br> <br>-function delete_replace_update(engine_name, iterations)<br>+function engine_long_module.delete_replace_update(engine_name, iterations)<br>     local string_value<br>     if (box.space._space.index.name:select{'tester'}[1] ~= nil) then<br>         box.space.tester:drop()<br>@@ -69,7 +70,7 @@ function delete_replace_update(engine_name, iterations)<br>     return {counter, random_number, string_value_2, string_value_3}<br> end<br> <br>-function delete_insert(engine_name, iterations)<br>+function engine_long_module.delete_insert(engine_name, iterations)<br>     local string_value<br>     if (box.space._space.index.name:select{'tester'}[1] ~= nil) then<br>         box.space.tester:drop()<br>@@ -107,3 +108,5 @@ function delete_insert(engine_name, iterations)<br>     box.space.tester:drop()<br>     return {counter, string_value_2}<br> end<br>+<br>+return engine_long_module<br>diff --git a/test/long_run-py/suite.ini b/test/long_run-py/suite.ini<br>index 251f88af6..aacda0d91 100644<br>--- a/test/long_run-py/suite.ini<br>+++ b/test/long_run-py/suite.ini<br>@@ -8,3 +8,4 @@ release_disabled =<br> lua_libs = suite.lua<br> use_unix_sockets = True<br> is_parallel = False<br>+pretest_clean = True<br>diff --git a/test/luajit-tap/suite.ini b/test/luajit-tap/suite.ini<br>index d5b1aa798..969742ec4 100644<br>--- a/test/luajit-tap/suite.ini<br>+++ b/test/luajit-tap/suite.ini<br>@@ -2,3 +2,4 @@<br> core = app<br> description = Luajit tests<br> is_parallel = False<br>+pretest_clean = True<br>diff --git a/test/replication-py/suite.ini b/test/replication-py/suite.ini<br>index f0ae98896..49e28916a 100644<br>--- a/test/replication-py/suite.ini<br>+++ b/test/replication-py/suite.ini<br>@@ -3,3 +3,4 @@ core = tarantool<br> script =  master.lua<br> description = tarantool/box, replication<br> is_parallel = False<br>+pretest_clean = True<br>diff --git a/test/replication/suite.ini b/test/replication/suite.ini<br>index 6e9e3edd0..74348b2d6 100644<br>--- a/test/replication/suite.ini<br>+++ b/test/replication/suite.ini<br>@@ -9,3 +9,4 @@ lua_libs = lua/fast_replica.lua lua/rlimit.lua<br> use_unix_sockets = True<br> long_run = prune.test.lua<br> is_parallel = True<br>+pretest_clean = True<br>diff --git a/test/sql-tap/suite.ini b/test/sql-tap/suite.ini<br>index faa56a999..270b19bc9 100644<br>--- a/test/sql-tap/suite.ini<br>+++ b/test/sql-tap/suite.ini<br>@@ -11,3 +11,4 @@ release_disabled = debug_mode_only.test.lua<br> long_run = gh-3332-tuple-format-leak.test.lua, gh-3083-ephemeral-unref-tuples.test.lua<br> config = engine.cfg<br> show_reproduce_content = False<br>+pretest_clean = True<br>diff --git a/test/sql/suite.ini b/test/sql/suite.ini<br>index ce6ccb79a..1ddbc684e 100644<br>--- a/test/sql/suite.ini<br>+++ b/test/sql/suite.ini<br>@@ -7,3 +7,4 @@ config = engine.cfg<br> is_parallel = True<br> lua_libs = lua/sql_tokenizer.lua<br> release_disabled = errinj.test.lua view_delayed_wal.test.lua sql-debug.test.lua<br>+pretest_clean = True<br>diff --git a/test/unit/suite.ini b/test/unit/suite.ini<br>index 75c80ece1..df9b458ee 100644<br>--- a/test/unit/suite.ini<br>+++ b/test/unit/suite.ini<br>@@ -2,3 +2,4 @@<br> core = unittest<br> description = unit tests<br> is_parallel = True<br>+pretest_clean = True<br>diff --git a/test/vinyl/suite.ini b/test/vinyl/suite.ini<br>index d2a194d85..3612cf44b 100644<br>--- a/test/vinyl/suite.ini<br>+++ b/test/vinyl/suite.ini<br>@@ -9,3 +9,4 @@ use_unix_sockets = True<br> long_run = stress.test.lua large.test.lua write_iterator_rand.test.lua dump_stress.test.lua select_consistency.test.lua throttle.test.lua<br> is_parallel = False<br> disabled = upgrade.test.lua<br>+pretest_clean = True<br>diff --git a/test/wal_off/suite.ini b/test/wal_off/suite.ini<br>index bd3a349db..679104f82 100644<br>--- a/test/wal_off/suite.ini<br>+++ b/test/wal_off/suite.ini<br>@@ -4,3 +4,4 @@ script = wal.lua<br> description = tarantool/box, wal_mode = none<br> use_unix_sockets = True<br> is_parallel = True<br>+pretest_clean = True<br>diff --git a/test/xlog-py/suite.ini b/test/xlog-py/suite.ini<br>index d7d512b0d..cad0b0041 100644<br>--- a/test/xlog-py/suite.ini<br>+++ b/test/xlog-py/suite.ini<br>@@ -5,3 +5,4 @@ script = box.lua<br> lua_libs = lua/fiber.lua lua/fifo.lua<br> use_unix_sockets = True<br> is_parallel = False<br>+pretest_clean = True<br>diff --git a/test/xlog/suite.ini b/test/xlog/suite.ini<br>index 4043f3700..06cfbb068 100644<br>--- a/test/xlog/suite.ini<br>+++ b/test/xlog/suite.ini<br>@@ -9,3 +9,4 @@ config = suite.cfg<br> use_unix_sockets = True<br> long_run = snap_io_rate.test.lua<br> is_parallel = True<br>+pretest_clean = True<br>-- <br>2.17.1<br><br><br><br><br>-- <br>Alexander Tikhonov</p></BODY></HTML>