From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Sergei Voronezhskii Subject: [PATCH v2 3/5] test: put require in proper places Date: Fri, 19 Oct 2018 19:17:19 +0300 Message-Id: <20181019161721.49560-4-sergw@tarantool.org> In-Reply-To: <20181019161721.49560-1-sergw@tarantool.org> References: <20181019161721.49560-1-sergw@tarantool.org> To: tarantool-patches@freelists.org Cc: Alexander Turenko , Vladimir Davydov List-ID: * put `require('fiber')` after each switch server command, because sometimes got 'fiber' not defined error * use `require('fio')` after `require('test_run').new()`, because sometimes got 'fio' not defined error Part of #2436, #3232 --- test/replication/catch.test.lua | 1 - test/replication/gc.result | 6 +++--- test/replication/gc.test.lua | 2 +- test/replication/on_replace.result | 3 +++ test/replication/on_replace.test.lua | 1 + 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/test/replication/catch.test.lua b/test/replication/catch.test.lua index 685c3e869..9ceb2fb9c 100644 --- a/test/replication/catch.test.lua +++ b/test/replication/catch.test.lua @@ -2,7 +2,6 @@ env = require('test_run') test_run = env.new() engine = test_run:get_cfg('engine') - net_box = require('net.box') errinj = box.error.injection diff --git a/test/replication/gc.result b/test/replication/gc.result index dad5539de..631944da5 100644 --- a/test/replication/gc.result +++ b/test/replication/gc.result @@ -1,6 +1,3 @@ -fio = require 'fio' ---- -... test_run = require('test_run').new() --- ... @@ -13,6 +10,9 @@ replica_set = require('fast_replica') fiber = require('fiber') --- ... +fio = require('fio') +--- +... test_run:cleanup_cluster() --- ... diff --git a/test/replication/gc.test.lua b/test/replication/gc.test.lua index 22921289d..8c3337613 100644 --- a/test/replication/gc.test.lua +++ b/test/replication/gc.test.lua @@ -1,8 +1,8 @@ -fio = require 'fio' test_run = require('test_run').new() engine = test_run:get_cfg('engine') replica_set = require('fast_replica') fiber = require('fiber') +fio = require('fio') test_run:cleanup_cluster() test_run:cmd("create server replica with rpl_master=default, script='replication/replica.lua'") diff --git a/test/replication/on_replace.result b/test/replication/on_replace.result index 8fef8fb14..2e95b90ea 100644 --- a/test/replication/on_replace.result +++ b/test/replication/on_replace.result @@ -63,6 +63,9 @@ test_run:cmd("switch replica") --- - true ... +fiber = require('fiber') +--- +... while box.space.test:count() < 2 do fiber.sleep(0.01) end --- ... diff --git a/test/replication/on_replace.test.lua b/test/replication/on_replace.test.lua index 23a3313b5..e34832103 100644 --- a/test/replication/on_replace.test.lua +++ b/test/replication/on_replace.test.lua @@ -26,6 +26,7 @@ session_type test_run:cmd("switch default") box.space.test:insert{2} test_run:cmd("switch replica") +fiber = require('fiber') while box.space.test:count() < 2 do fiber.sleep(0.01) end -- -- applier -- 2.18.0