From: sergeyb@tarantool.org
To: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org,
imun@tarantool.org
Cc: o.piskunov@tarantool.org, alexander.turenko@tarantool.org
Subject: [Tarantool-patches] [PATCH v6 20/25] Fix luacheck warnings in test/vinyl
Date: Fri, 29 May 2020 18:09:32 +0300 [thread overview]
Message-ID: <1a420e17c8be06c68d0197eab4fa6763cd118b34.1590764168.git.sergeyb@tarantool.org> (raw)
In-Reply-To: <cover.1590764167.git.sergeyb@tarantool.org>
From: Sergey Bronnikov <sergeyb@tarantool.org>
Part of #4681
Reviewed-by: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Reviewed-by: Igor Munkin <imun@tarantool.org>
Co-authored-by: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Co-authored-by: Igor Munkin <imun@tarantool.org>
---
.luacheckrc | 2 +-
test/vinyl/large.lua | 3 +--
test/vinyl/stress.lua | 22 +++++++++++-----------
test/vinyl/txn_proxy.lua | 6 +++---
test/vinyl/upgrade/fill.lua | 8 ++++----
test/vinyl/vinyl.lua | 17 -----------------
6 files changed, 20 insertions(+), 38 deletions(-)
diff --git a/.luacheckrc b/.luacheckrc
index 196ec82d7..5bb49ec14 100644
--- a/.luacheckrc
+++ b/.luacheckrc
@@ -15,7 +15,7 @@ exclude_files = {
"test/sql/*.test.lua",
"test/swim/*.test.lua",
"test/var/**/*.lua",
- "test/vinyl/*.lua",
+ "test/vinyl/*.test.lua",
"test/wal_off/*.lua",
"test/xlog/*.lua",
"test-run/**/*.lua",
diff --git a/test/vinyl/large.lua b/test/vinyl/large.lua
index e10e94c1a..a997aec7e 100644
--- a/test/vinyl/large.lua
+++ b/test/vinyl/large.lua
@@ -1,5 +1,4 @@
-fiber = require('fiber')
-digest = require('digest')
+local digest = require('digest')
local PAGE_SIZE = 1024
local RANGE_SIZE = 64 * PAGE_SIZE
diff --git a/test/vinyl/stress.lua b/test/vinyl/stress.lua
index 5e8d89795..15a999393 100644
--- a/test/vinyl/stress.lua
+++ b/test/vinyl/stress.lua
@@ -33,8 +33,8 @@ local spaces = {box.space.s1, box.space.s2, box.space.s3, box.space.s4,
local max_data_size = box.cfg.vinyl_page_size * 1.5
local function t1(ch, time_limit)
- local t1 = fiber.time()
- while fiber.time() - t1 < time_limit do
+ local time = fiber.time()
+ while fiber.time() - time < time_limit do
local k = math.random(10000)
local t = math.random(80)
local data = string.char(math.random(string.byte('Z') - string.byte('A')) + string.byte('A') - 1)
@@ -56,13 +56,13 @@ local function t1(ch, time_limit)
end;
local function t2(ch, time_limit)
- local t1 = fiber.time()
- while fiber.time() - t1 < time_limit do
+ local time = fiber.time()
+ while fiber.time() - time < time_limit do
local k = math.random(10000)
local t = math.random(16)
local space = spaces[math.fmod(t, #spaces) + 1]
if t < 12 then
- local l = space:get({k})
+ space:get({k})
else
space:delete({k})
end
@@ -71,9 +71,9 @@ local function t2(ch, time_limit)
end;
local function t3(ch, time_limit)
- local t1 = fiber.time()
+ local time = fiber.time()
local i = 0
- while fiber.time() - t1 < time_limit do
+ while fiber.time() - time < time_limit do
i = i + 1
local k = math.random(10000)
local t = math.random(20)
@@ -99,19 +99,19 @@ local function stress(time_limit)
math.randomseed(os.time());
- for i = 1, 6 do
+ for _ = 1, 6 do
fiber.create(t1, ch, time_limit)
end;
- for i = 1, 6 do
+ for _ = 1, 6 do
fiber.create(t2, ch, time_limit)
end;
- for i = 1, 4 do
+ for _ = 1, 4 do
fiber.create(t3, ch, time_limit)
end;
- for i = 1, 16 do
+ for _ = 1, 16 do
ch:get()
end;
end
diff --git a/test/vinyl/txn_proxy.lua b/test/vinyl/txn_proxy.lua
index 7a4d0b865..15b0e4add 100644
--- a/test/vinyl/txn_proxy.lua
+++ b/test/vinyl/txn_proxy.lua
@@ -1,11 +1,11 @@
--- A fiber can't use multiple transactions simultaneously;
+-- A fiber can't use multiple transactions simultaneously;
-- i.e. [fiber] --? [transaction] in UML parlor.
--
-- This module provides a simple transaction proxy facility
--- to control multiple transactions at once. A proxy executes
+-- to control multiple transactions at once. A proxy executes
-- statements in a worker fiber in order to overcome
-- "one transaction per fiber" limitation.
---
+--
-- Ex:
-- proxy = require('txn_proxy').new()
-- proxy:begin()
diff --git a/test/vinyl/upgrade/fill.lua b/test/vinyl/upgrade/fill.lua
index 547777330..0164b9316 100644
--- a/test/vinyl/upgrade/fill.lua
+++ b/test/vinyl/upgrade/fill.lua
@@ -2,11 +2,11 @@
-- This script generates a vinyl metadata log
-- containing all possible record types.
--
-fiber = require 'fiber'
+local fiber = require 'fiber'
box.cfg{vinyl_memory = 1024 * 1024, vinyl_timeout = 1e-9, checkpoint_count = 1}
-dump_trigger = box.schema.space.create('dump_trigger', {engine = 'vinyl'})
+local dump_trigger = box.schema.space.create('dump_trigger', {engine = 'vinyl'})
dump_trigger:create_index('pk', {run_count_per_level = 1})
-- Trigger dump of all indexes and wait for it to finish.
@@ -15,7 +15,7 @@ dump_trigger:create_index('pk', {run_count_per_level = 1})
-- to trigger system-wide memory dump, it is enough to insert a
-- huge tuple into one space.
--
-function dump()
+local function dump()
local pad = string.rep('x', box.cfg.vinyl_memory / 2)
dump_trigger:replace{1, pad}
-- Must fail due to quota timeout, but still trigger dump.
@@ -38,7 +38,7 @@ end
-- VY_LOG_CREATE_INDEX
-- VY_LOG_INSERT_RANGE
--
-s = box.schema.space.create('test', {engine = 'vinyl'})
+local s = box.schema.space.create('test', {engine = 'vinyl'})
s:create_index('i1', {parts = {1, 'unsigned'}, run_count_per_level = 1})
s:create_index('i2', {parts = {2, 'string'}, run_count_per_level = 2})
diff --git a/test/vinyl/vinyl.lua b/test/vinyl/vinyl.lua
index 31307f4bc..1d313b4e4 100644
--- a/test/vinyl/vinyl.lua
+++ b/test/vinyl/vinyl.lua
@@ -15,21 +15,4 @@ box.cfg {
vinyl_max_tuple_size = 1024 * 1024 * 6,
}
-function box_info_sort(data)
- if type(data)~='table' then
- return data
- end
- local keys = {}
- for k in pairs(data) do
- table.insert(keys, k)
- end
- table.sort(keys)
- local result = {}
- for _,k in pairs(keys) do
- local v = data[k]
- table.insert(result, {[k] = box_info_sort(v) })
- end
- return result
-end
-
require('console').listen(os.getenv('ADMIN'))
--
2.23.0
next prev parent reply other threads:[~2020-05-29 15:16 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-29 15:08 [Tarantool-patches] [PATCH v6 00/25] Add static analysis with luacheck sergeyb
2020-05-29 15:08 ` [Tarantool-patches] [PATCH v6 01/25] Add initial luacheck config sergeyb
2020-05-29 16:04 ` Igor Munkin
2020-05-29 16:27 ` Igor Munkin
2020-05-30 12:19 ` Sergey Bronnikov
2020-05-30 12:18 ` Sergey Bronnikov
2020-05-29 15:08 ` [Tarantool-patches] [PATCH v6 02/25] build: enable 'make luacheck' target sergeyb
2020-05-29 16:28 ` Igor Munkin
2020-05-29 15:08 ` [Tarantool-patches] [PATCH v6 03/25] gitlab-ci: enable static analysis with luacheck sergeyb
2020-05-29 19:25 ` Igor Munkin
2020-06-01 9:29 ` Sergey Bronnikov
2020-06-01 9:48 ` Igor Munkin
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 04/25] Fix luacheck warnings in extra/dist/tarantoolctl.in sergeyb
2020-05-29 16:35 ` Igor Munkin
2020-06-01 14:10 ` Alexander Turenko
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 05/25] Fix luacheck warnings in src/lua/ sergeyb
2020-05-29 16:51 ` Igor Munkin
2020-05-29 19:13 ` Igor Munkin
2020-05-30 12:15 ` Sergey Bronnikov
2020-06-01 9:43 ` Igor Munkin
2020-06-01 10:36 ` Sergey Bronnikov
2020-06-01 9:38 ` Sergey Bronnikov
2020-06-01 14:47 ` Alexander Turenko
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 06/25] Fix luacheck warnings in src/box/lua/ sergeyb
2020-05-29 19:11 ` Igor Munkin
2020-05-30 12:22 ` Sergey Bronnikov
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 07/25] Supress luacheck warnings in test/app sergeyb
2020-06-01 10:11 ` Igor Munkin
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 08/25] Fix luacheck warnings in test/app-tap sergeyb
2020-06-01 11:41 ` Igor Munkin
2020-07-16 11:44 ` Sergey Bronnikov
2020-07-16 12:42 ` Igor Munkin
2020-07-16 13:25 ` Sergey Bronnikov
2020-06-01 13:37 ` Alexander Turenko
2020-06-01 16:37 ` Igor Munkin
2020-06-01 17:13 ` Alexander Turenko
2020-06-01 17:38 ` Igor Munkin
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 09/25] Fix luacheck warnings in test/box sergeyb
2020-06-01 16:06 ` Igor Munkin
2020-07-16 13:23 ` Sergey Bronnikov
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 10/25] Fix luacheck warnings in test/box-py sergeyb
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 11/25] Fix luacheck warnings in test/box-tap sergeyb
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 12/25] Fix luacheck warnings in test/engine sergeyb
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 13/25] Fix luacheck warnings in test/engine_long sergeyb
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 14/25] Fix luacheck warnings in test/long_run-py sergeyb
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 15/25] Fix luacheck warnings in test/replication sergeyb
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 16/25] Fix luacheck warnings in test/replication-py sergeyb
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 17/25] Fix luacheck warnings in test/sql sergeyb
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 18/25] Fix luacheck warnings in test/sql-tap sergeyb
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 19/25] Fix luacheck warnings in test/swim sergeyb
2020-05-29 15:09 ` sergeyb [this message]
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 21/25] Fix luacheck warnings in test/wal_off sergeyb
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 22/25] Fix luacheck warnings in test/xlog sergeyb
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 23/25] Fix luacheck warnings in test/xlog-py sergeyb
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 24/25] Add luacheck supressions for luajit tests sergeyb
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 25/25] luajit: bump new version sergeyb
2020-06-01 17:08 ` [Tarantool-patches] [PATCH v6 00/25] Add static analysis with luacheck Vladislav Shpilevoy
2020-06-01 17:29 ` Alexander Turenko
2020-06-01 18:13 ` Igor Munkin
2020-06-02 14:42 ` Alexander Turenko
2020-06-02 15:58 ` Igor Munkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1a420e17c8be06c68d0197eab4fa6763cd118b34.1590764168.git.sergeyb@tarantool.org \
--to=sergeyb@tarantool.org \
--cc=alexander.turenko@tarantool.org \
--cc=imun@tarantool.org \
--cc=o.piskunov@tarantool.org \
--cc=tarantool-patches@dev.tarantool.org \
--cc=v.shpilevoy@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH v6 20/25] Fix luacheck warnings in test/vinyl' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox