From: Alexander Turenko <alexander.turenko@tarantool.org>
To: Nikita Pettik <korablev@tarantool.org>
Cc: Alexander Turenko <alexander.turenko@tarantool.org>,
tarantool-patches@freelists.org
Subject: [tarantool-patches] [PATCH] Increase time quota for selectG test on vinyl
Date: Tue, 31 Jul 2018 23:22:36 +0300 [thread overview]
Message-ID: <463200fa21cf8c512265fedf13ded1008d3ed55a.1533068430.git.alexander.turenko@tarantool.org> (raw)
The test case has execution time around 25 seconds on vinyl (while
around 5 seconds on memtx) on a slow laptop with HDD. On a modern laptop
with SSD it is ~8 seconds for vinyl and ~2-3 seconds for memtx. Both
measurement were performed with parallel run of many instances of the
test.
Also enabled ability to run a sql-tap test w/o test-run. It was broken
since b09f5964.
Fixes #3590.
---
branch: Totktonada/gh-3590-fix-sql-tap-selectG-flaky-fail
travis-ci: https://travis-ci.org/tarantool/tarantool/builds/410505565
test/sql-tap/lua/sqltester.lua | 21 +++++++++++++++++----
test/sql-tap/selectG.test.lua | 7 ++++++-
2 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/test/sql-tap/lua/sqltester.lua b/test/sql-tap/lua/sqltester.lua
index 04138154b..8751ef820 100644
--- a/test/sql-tap/lua/sqltester.lua
+++ b/test/sql-tap/lua/sqltester.lua
@@ -3,6 +3,12 @@ local json = require('json')
local test = tap.test("errno")
local sql_tokenizer = require('sql_tokenizer')
+-- pcall here, because we allow to run a test w/o test-run; use:
+-- LUA_PATH='test/sql-tap/lua/?.lua;test/sql/lua/?.lua;;' \
+-- ./test/sql-tap/xxx.test.lua
+local ok, test_run = pcall(require, 'test_run')
+test_run = ok and test_run.new() or nil
+
local function flatten(arr)
local result = { }
@@ -411,8 +417,12 @@ test.do_eqp_test = function (self, label, sql, result)
end
setmetatable(_G, nil)
-os.execute("rm -rf $(ls -d */)")
-os.execute("rm -f *.snap *.xlog* *.vylog* *.run*")
+
+-- perform clean up only under test-run
+if test_run then
+ os.execute("rm -rf $(ls -d */)")
+ os.execute("rm -f *.snap *.xlog* *.vylog* *.run*")
+end
-- start the database
box.cfg{
@@ -421,8 +431,11 @@ box.cfg{
log="tarantool.log";
}
-test_run = require('test_run').new()
-engine = test_run:get_cfg('engine')
+local engine = test_run and test_run:get_cfg('engine') or 'memtx'
box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
+function test.engine(self)
+ return engine
+end
+
return test
diff --git a/test/sql-tap/selectG.test.lua b/test/sql-tap/selectG.test.lua
index f9732658e..d83b790f1 100755
--- a/test/sql-tap/selectG.test.lua
+++ b/test/sql-tap/selectG.test.lua
@@ -27,6 +27,10 @@ testprefix = "selectG"
-- for an O(N*N) inefficiency that was once in the code and that would make
-- the insert run for over a minute.
--
+local engine = test:engine()
+local time_quota =
+ engine == 'memtx' and 25 or (
+ engine == 'vinyl' and 50 or 0) -- seconds
test:do_test(
100,
function()
@@ -42,7 +46,8 @@ test:do_test(
test:execsql(sql)
local end_time = os.time()
-- max run time was increased because of parallel test run
- return test:execsql( "SELECT count(x), sum(x), avg(x), "..(end_time - start_time).."<25 FROM t1;")
+ return test:execsql(("SELECT count(x), sum(x), avg(x), %d<%d FROM t1;")
+ :format(end_time - start_time, time_quota))
end, {
-- <100>
100000, 5000050000, 50000.5, 1
--
2.17.1
next reply other threads:[~2018-07-31 20:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-31 20:22 Alexander Turenko [this message]
2018-08-03 13:57 ` [tarantool-patches] " n.pettik
2018-08-03 15:23 ` Alexander Turenko
2018-08-03 15:38 ` Kirill Yukhin
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=463200fa21cf8c512265fedf13ded1008d3ed55a.1533068430.git.alexander.turenko@tarantool.org \
--to=alexander.turenko@tarantool.org \
--cc=korablev@tarantool.org \
--cc=tarantool-patches@freelists.org \
--subject='Re: [tarantool-patches] [PATCH] Increase time quota for selectG test on 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