From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp51.i.mail.ru (smtp51.i.mail.ru [94.100.177.111]) (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 A9F324696C3 for ; Fri, 10 Apr 2020 16:27:09 +0300 (MSK) Date: Fri, 10 Apr 2020 16:27:07 +0300 From: Sergey Bronnikov Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Subject: [Tarantool-patches] [PATCH] Fix flaky test engine/ddl List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: sergepetrenko@tarantool.org, tarantool-patches@dev.tarantool.org, avtikhon@tarantool.org, o.piskunov@tarantool.org Test was a flaky from the beginning 39d0e4273dde2dbb3e46aea35310379e98e7cc64 Time of building indexes varies from time to time and the problem was due to abcense of synchronization in index building and checking numbers of these indexes. Fixes #4353 --- test/engine/ddl.result | 15 +++++++++------ test/engine/ddl.test.lua | 14 ++++++++------ test/engine/suite.ini | 3 +-- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/test/engine/ddl.result b/test/engine/ddl.result index 67b22ed9e..6cf429c9b 100644 --- a/test/engine/ddl.result +++ b/test/engine/ddl.result @@ -2461,20 +2461,23 @@ ch:get() --- - true ... -box.space.test.index.pk:count() == box.space.test.index.sk:count() +inspector:wait_cond(function() return box.space.test.index.pk:count() == box.space.test.index.sk:count() end) --- - true ... -box.space.test.index.pk:count() == box.space.test.index.tk:count() +inspector:wait_cond(function() return box.space.test.index.pk:count() == box.space.test.index.tk:count() end) --- - true ... inspector:cmd("restart server default") -box.space.test.index.pk:count() == box.space.test.index.sk:count() +inspector = require('test_run').new() +--- +... +inspector:wait_cond(function() return box.space.test.index.pk:count() == box.space.test.index.sk:count() end) --- - true ... -box.space.test.index.pk:count() == box.space.test.index.tk:count() +inspector:wait_cond(function() return box.space.test.index.pk:count() == box.space.test.index.tk:count() end) --- - true ... @@ -2482,11 +2485,11 @@ box.snapshot() --- - ok ... -box.space.test.index.pk:count() == box.space.test.index.sk:count() +inspector:wait_cond(function() return box.space.test.index.pk:count() == box.space.test.index.sk:count() end) --- - true ... -box.space.test.index.pk:count() == box.space.test.index.tk:count() +inspector:wait_cond(function() return box.space.test.index.pk:count() == box.space.test.index.tk:count() end) --- - true ... diff --git a/test/engine/ddl.test.lua b/test/engine/ddl.test.lua index e761966d7..57f1beb03 100644 --- a/test/engine/ddl.test.lua +++ b/test/engine/ddl.test.lua @@ -976,15 +976,17 @@ _ = fiber.create(function() gen_load() ch:put(true) end) _ = box.space.test:create_index('tk', {unique = true, parts = {3, 'unsigned'}}) ch:get() -box.space.test.index.pk:count() == box.space.test.index.sk:count() -box.space.test.index.pk:count() == box.space.test.index.tk:count() +inspector:wait_cond(function() return box.space.test.index.pk:count() == box.space.test.index.sk:count() end) +inspector:wait_cond(function() return box.space.test.index.pk:count() == box.space.test.index.tk:count() end) inspector:cmd("restart server default") -box.space.test.index.pk:count() == box.space.test.index.sk:count() -box.space.test.index.pk:count() == box.space.test.index.tk:count() +inspector = require('test_run').new() + +inspector:wait_cond(function() return box.space.test.index.pk:count() == box.space.test.index.sk:count() end) +inspector:wait_cond(function() return box.space.test.index.pk:count() == box.space.test.index.tk:count() end) box.snapshot() -box.space.test.index.pk:count() == box.space.test.index.sk:count() -box.space.test.index.pk:count() == box.space.test.index.tk:count() +inspector:wait_cond(function() return box.space.test.index.pk:count() == box.space.test.index.sk:count() end) +inspector:wait_cond(function() return box.space.test.index.pk:count() == box.space.test.index.tk:count() end) box.space.test:drop() diff --git a/test/engine/suite.ini b/test/engine/suite.ini index 5ae12a431..e78b8c261 100644 --- a/test/engine/suite.ini +++ b/test/engine/suite.ini @@ -10,5 +10,4 @@ config = engine.cfg lua_libs = conflict.lua ../box/lua/utils.lua ../box/lua/push.lua is_parallel = True pretest_clean = True -fragile = ddl.test.lua ; gh-4353 - recover_wal.test.lua ; gh-3767 +fragile = recover_wal.test.lua ; gh-3767 -- 2.23.0 -- sergeyb@