From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id CC706208F9 for ; Tue, 31 Jul 2018 16:23:11 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id r1er1u-EucJe for ; Tue, 31 Jul 2018 16:23:11 -0400 (EDT) Received: from smtp5.mail.ru (smtp5.mail.ru [94.100.179.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 68C7127687 for ; Tue, 31 Jul 2018 16:22:39 -0400 (EDT) From: Alexander Turenko Subject: [tarantool-patches] [PATCH] Increase time quota for selectG test on vinyl Date: Tue, 31 Jul 2018 23:22:36 +0300 Message-Id: <463200fa21cf8c512265fedf13ded1008d3ed55a.1533068430.git.alexander.turenko@tarantool.org> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: Nikita Pettik Cc: Alexander Turenko , tarantool-patches@freelists.org 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