From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp56.i.mail.ru (smtp56.i.mail.ru [217.69.128.36]) (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 51C554696C4 for ; Wed, 15 Apr 2020 02:29:33 +0300 (MSK) References: <37835c4eb52f9ac21b6e7347a19cf5ded543b3c9.1586849129.git.sergeyb@tarantool.org> From: Vladislav Shpilevoy Message-ID: Date: Wed, 15 Apr 2020 01:29:30 +0200 MIME-Version: 1.0 In-Reply-To: <37835c4eb52f9ac21b6e7347a19cf5ded543b3c9.1586849129.git.sergeyb@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH 2/6] Fix luacheck warnings in test/ List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sergey Bronnikov , tarantool-patches@dev.tarantool.org, avtikhon@tarantool.org, alexander.turenko@tarantool.org, o.piskunov@tarantool.org Thanks for the patch! Consider more fixes below and on the branch in a separate commit. That allowed to remove some warning mutes from the luacheck config. ==================== Review fixes: test/ diff --git a/test/app-tap/console_lua.test.lua b/test/app-tap/console_lua.test.lua index 3ed6aad97..d0e290d9c 100755 --- a/test/app-tap/console_lua.test.lua +++ b/test/app-tap/console_lua.test.lua @@ -13,7 +13,7 @@ local CONSOLE_SOCKET = 'console-lua.sock' -- -- Set Lua output mode. local function set_lua_output(client, opts) - local opts = opts or {} + opts = opts or {} local mode = opts.block and 'lua,block' or 'lua' client:write(('\\set output %s\n'):format(mode)) assert(client:read(EOL), 'true' .. EOL, 'set lua output mode') diff --git a/test/app-tap/fail_main.test.lua b/test/app-tap/fail_main.test.lua index f8c45bf6f..917577f46 100755 --- a/test/app-tap/fail_main.test.lua +++ b/test/app-tap/fail_main.test.lua @@ -16,7 +16,7 @@ function run_script(code) script:close() local output_file = fio.pathjoin(fio.cwd(), 'out.txt') local cmd = [[/bin/sh -c 'cd "%s" && "%s" ./script.lua 0> %s 2> %s']] - local code = os.execute( + code = os.execute( string.format(cmd, dir, tarantool_bin, output_file, output_file) ) fio.rmtree(dir) diff --git a/test/app-tap/tarantoolctl.test.lua b/test/app-tap/tarantoolctl.test.lua index 4d7059559..3fda53274 100755 --- a/test/app-tap/tarantoolctl.test.lua +++ b/test/app-tap/tarantoolctl.test.lua @@ -97,23 +97,14 @@ local function tctl_wait_start(dir, name) fiber.sleep(0.01) end ::again:: - while true do - local stat, nb = pcall(require('net.box').new, path, { - wait_connected = true, console = true - }) - if stat == false then - fiber.sleep(0.01) - goto again - else - break - end - local stat, msg = pcall(nb.eval, nb, 'require("fiber").time()') - if stat == false then - fiber.sleep(0.01) - else - break - end + local stat, nb = pcall(require('net.box').new, path, { + wait_connected = true, console = true + }) + if stat == false then + fiber.sleep(0.01) + goto again end + return end end