From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp53.i.mail.ru (smtp53.i.mail.ru [94.100.177.113]) (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 757984696C3 for ; Sat, 11 Apr 2020 15:55:08 +0300 (MSK) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) From: Serge Petrenko In-Reply-To: Date: Sat, 11 Apr 2020 15:55:07 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: Subject: Re: [Tarantool-patches] [PATCH] Fix flaky test engine/ddl List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sergey Bronnikov Cc: o.piskunov@tarantool.org, tml Hi! Thanks for the patch! > 10 =D0=B0=D0=BF=D1=80. 2020 =D0=B3., =D0=B2 16:27, Sergey Bronnikov = =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0=B0)= : >=20 > 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. >=20 > Fixes #4353 > --- Please attach links to the issue and branch after `---` next time. > test/engine/ddl.result | 15 +++++++++------ > test/engine/ddl.test.lua | 14 ++++++++------ > test/engine/suite.ini | 3 +-- > 3 files changed, 18 insertions(+), 14 deletions(-) >=20 > 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() =3D=3D = box.space.test.index.sk:count() > +inspector:wait_cond(function() return box.space.test.index.pk:count() = =3D=3D box.space.test.index.sk:count() end) > --- > - true > ... > -box.space.test.index.pk:count() =3D=3D = box.space.test.index.tk:count() > +inspector:wait_cond(function() return box.space.test.index.pk:count() = =3D=3D box.space.test.index.tk:count() end) > --- > - true > ... > inspector:cmd("restart server default") > -box.space.test.index.pk:count() =3D=3D = box.space.test.index.sk:count() > +inspector =3D require('test_run').new() > +--- > +... > +inspector:wait_cond(function() return box.space.test.index.pk:count() = =3D=3D box.space.test.index.sk:count() end) > --- > - true > ... > -box.space.test.index.pk:count() =3D=3D = box.space.test.index.tk:count() > +inspector:wait_cond(function() return box.space.test.index.pk:count() = =3D=3D box.space.test.index.tk:count() end) > --- > - true > ... > @@ -2482,11 +2485,11 @@ box.snapshot() > --- > - ok > ... > -box.space.test.index.pk:count() =3D=3D = box.space.test.index.sk:count() > +inspector:wait_cond(function() return box.space.test.index.pk:count() = =3D=3D box.space.test.index.sk:count() end) > --- > - true > ... > -box.space.test.index.pk:count() =3D=3D = box.space.test.index.tk:count() > +inspector:wait_cond(function() return box.space.test.index.pk:count() = =3D=3D 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 @@ _ =3D fiber.create(function() gen_load() = ch:put(true) end) > _ =3D box.space.test:create_index('tk', {unique =3D true, parts =3D = {3, 'unsigned'}}) > ch:get() >=20 > -box.space.test.index.pk:count() =3D=3D = box.space.test.index.sk:count() > -box.space.test.index.pk:count() =3D=3D = box.space.test.index.tk:count() > +inspector:wait_cond(function() return box.space.test.index.pk:count() = =3D=3D box.space.test.index.sk:count() end) > +inspector:wait_cond(function() return box.space.test.index.pk:count() = =3D=3D box.space.test.index.tk:count() end) >=20 > inspector:cmd("restart server default") >=20 > -box.space.test.index.pk:count() =3D=3D = box.space.test.index.sk:count() > -box.space.test.index.pk:count() =3D=3D = box.space.test.index.tk:count() > +inspector =3D require('test_run').new() > + > +inspector:wait_cond(function() return box.space.test.index.pk:count() = =3D=3D box.space.test.index.sk:count() end) > +inspector:wait_cond(function() return box.space.test.index.pk:count() = =3D=3D box.space.test.index.tk:count() end) > box.snapshot() > -box.space.test.index.pk:count() =3D=3D = box.space.test.index.sk:count() > -box.space.test.index.pk:count() =3D=3D = box.space.test.index.tk:count() > +inspector:wait_cond(function() return box.space.test.index.pk:count() = =3D=3D box.space.test.index.sk:count() end) > +inspector:wait_cond(function() return box.space.test.index.pk:count() = =3D=3D box.space.test.index.tk:count() end) I think the check can=E2=80=99t fail after `box.snapshot()` even without = wait_cond(). You=E2=80=99ve already waited for the index to build right before = `box.snapshot()`. It=E2=80=99 s better to leave the last 2 checks without wait_cond to = emphasize that nothing could happen during `box.snapshot()`. >=20 > 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 =3D engine.cfg > lua_libs =3D conflict.lua ../box/lua/utils.lua ../box/lua/push.lua > is_parallel =3D True > pretest_clean =3D True > -fragile =3D ddl.test.lua ; gh-4353 > - recover_wal.test.lua ; gh-3767 > +fragile =3D recover_wal.test.lua ; gh-3767 > --=20 > 2.23.0 >=20 >=20 > --=20 > sergeyb@ -- Serge Petrenko sergepetrenko@tarantool.org