From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 117864696C7 for ; Tue, 26 Nov 2019 09:22:02 +0300 (MSK) From: "Alexander V. Tikhonov" Date: Tue, 26 Nov 2019 09:21:46 +0300 Message-Id: <31a85b0452751f35fdee03d334df5e366677486c.1574749278.git.avtikhon@tarantool.org> In-Reply-To: <1c42ad20160f47d942cab405ce9896d6d31cc05f.1574749278.git.avtikhon@tarantool.org> References: <1c42ad20160f47d942cab405ce9896d6d31cc05f.1574749278.git.avtikhon@tarantool.org> In-Reply-To: <1c42ad20160f47d942cab405ce9896d6d31cc05f.1574749278.git.avtikhon@tarantool.org> References: <1c42ad20160f47d942cab405ce9896d6d31cc05f.1574749278.git.avtikhon@tarantool.org> Subject: [Tarantool-patches] [PATCH v1 10/12] test: put require in proper places List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kirill Yukhin Cc: Sergei Voronezhskii , tarantool-patches@dev.tarantool.org From: Sergei Voronezhskii * 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 (cherry picked from commit d2f28afaf7f045687df191cd93c935dcc442811b) --- 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 d5de88642..7a531df39 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 5b44284bf..cbdeffb11 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 fee1fe968..4710fd9e3 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.17.1