From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp49.i.mail.ru (smtp49.i.mail.ru [94.100.177.109]) (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 72FD54696C3 for ; Fri, 17 Apr 2020 00:15:50 +0300 (MSK) Date: Fri, 17 Apr 2020 00:15:47 +0300 From: Mergen Imeev Message-ID: <20200416211547.GA19535@tarantool.org> References: <1b7ea654465f9a92cb0949ce6286fee63e2be1ca.1587063872.git.imeevma@gmail.com> <1587064169.460537645@f501.i.mail.ru> <20200416191851.GA8455@tarantool.org> <20200416202451.GA15068@tarantool.org> <20200416210205.GB8455@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200416210205.GB8455@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v1 1/1] lua: fix test sql/func-recreate.test.lua List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikita Pettik Cc: tarantool-patches@dev.tarantool.org On Thu, Apr 16, 2020 at 09:02:05PM +0000, Nikita Pettik wrote: > On 16 Apr 23:24, Mergen Imeev wrote: > > Hi! Thank you for review. My answer below. > > > > On Thu, Apr 16, 2020 at 07:18:51PM +0000, Nikita Pettik wrote: > > > On 16 Apr 22:09, Alexander Tikhonov wrote: > > > > > > > > Hi Mergen, thanks for the patch, I’ve checked it on 2.2 and it runs fine, patch LGTM. > > > > > > > > > > Did you verify that modified test still reproduces initial problem? > > > I hope so, but ask just in case. > > According to history, the main goal of this part of the > > test is to show that sql_create_function() throws proper > > error in case a new function is created when transaction > > is active. Since the error still here, we may say that > > the test works. > > So the answer to my question is - no, you didn't test it. > Better safe than sorry - I'd better verify that updated > test still covers the initial problem. Thanks. > Doesn't my answer says that we checked it? However, I agree that it is never wrong to check it again. > > > > >Четверг, 16 апреля 2020, 22:07 +03:00 от imeevma@tarantool.org: > > > > >  > > > > >Closes #4384 > > > > >--- > > > > >https://github.com/tarantool/tarantool/issues/4384 > > > > >https://github.com/tarantool/tarantool/tree/imeevma/gh-4384-fix-test-func-recreate > > > > > > > > > >@ChangeLog > > > > > - Fixed flaky test sql/func-recreate.test.lua (gh-4384). > > > > > > > > > > test/sql/func-recreate.result | 19 +++++++++++-------- > > > > > test/sql/func-recreate.test.lua | 11 ++++++----- > > > > > test/sql/suite.ini | 1 - > > > > > 3 files changed, 17 insertions(+), 14 deletions(-) > > > > > > > > > >diff --git a/test/sql/func-recreate.result b/test/sql/func-recreate.result > > > > >index 73fb03c..470ce5a 100644 > > > > >--- a/test/sql/func-recreate.result > > > > >+++ b/test/sql/func-recreate.result > > > > >@@ -12,31 +12,34 @@ box.execute('pragma sql_default_engine=\''..engine..'\'') > > > > > fiber = require('fiber') > > > > > --- > > > > > ... > > > > >-box.internal.sql_create_function('WAITFOR', 'INT', function (n) fiber.sleep(n) return n end) > > > > >+flag = true > > > > > --- > > > > > ... > > > > >-ch = fiber.channel(1) > > > > >+box.internal.sql_create_function('WAITFOR', 'INT', function () while flag do fiber.sleep(0.01) end return 0 end) > > > > > --- > > > > > ... > > > > >-_ = fiber.create(function () ch:put(box.execute('select WAITFOR(0.2)')) end) > > > > >+ch = fiber.channel(1) > > > > > --- > > > > > ... > > > > >-fiber.sleep(0.1) > > > > >+_ = fiber.create(function () ch:put(box.execute('select WAITFOR()')) end) > > > > > --- > > > > > ... > > > > >-box.internal.sql_create_function('WAITFOR', 'INT', function (n) require('fiber').sleep(n) return n end) > > > > >+box.internal.sql_create_function('WAITFOR', 'INT', function () while flag do fiber.sleep(0.01) end return 0 end) > > > > > --- > > > > > - error: 'Failed to create function ''WAITFOR'': unable to create function due to > > > > >     active statements' > > > > > ... > > > > >+flag = false > > > > >+--- > > > > >+... > > > > > ch:get() > > > > > --- > > > > > - metadata: > > > > >- - name: WAITFOR(0.2) > > > > >+ - name: WAITFOR() > > > > >     type: integer > > > > >   rows: > > > > >- - [0.2] > > > > >+ - [0] > > > > > ... > > > > >-box.internal.sql_create_function('WAITFOR', 'INT', function (n) require('fiber').sleep(n) return n end) > > > > >+box.internal.sql_create_function('WAITFOR', 'INT', function () while flag do fiber.sleep(0.01) end return 0 end) > > > > > --- > > > > > ... > > > > >diff --git a/test/sql/func-recreate.test.lua b/test/sql/func-recreate.test.lua > > > > >index 753e9ca..d482fa9 100644 > > > > >--- a/test/sql/func-recreate.test.lua > > > > >+++ b/test/sql/func-recreate.test.lua > > > > >@@ -4,14 +4,15 @@ box.execute('pragma sql_default_engine=\''..engine..'\'') > > > > >  > > > > > -- Check errors during function create process > > > > > fiber = require('fiber') > > > > >-box.internal.sql_create_function('WAITFOR', 'INT', function (n) fiber.sleep(n) return n end) > > > > >+flag = true > > > > >+box.internal.sql_create_function('WAITFOR', 'INT', function () while flag do fiber.sleep(0.01) end return 0 end) > > > > >  > > > > > ch = fiber.channel(1) > > > > >  > > > > >-_ = fiber.create(function () ch:put(box.execute('select WAITFOR(0.2)')) end) > > > > >-fiber.sleep(0.1) > > > > >+_ = fiber.create(function () ch:put(box.execute('select WAITFOR()')) end) > > > > >  > > > > >-box.internal.sql_create_function('WAITFOR', 'INT', function (n) require('fiber').sleep(n) return n end) > > > > >+box.internal.sql_create_function('WAITFOR', 'INT', function () while flag do fiber.sleep(0.01) end return 0 end) > > > > >+flag = false > > > > > ch:get() > > > > >-box.internal.sql_create_function('WAITFOR', 'INT', function (n) require('fiber').sleep(n) return n end) > > > > >+box.internal.sql_create_function('WAITFOR', 'INT', function () while flag do fiber.sleep(0.01) end return 0 end) > > > > >  > > > > >diff --git a/test/sql/suite.ini b/test/sql/suite.ini > > > > >index a8664c5..cc1d641 100644 > > > > >--- a/test/sql/suite.ini > > > > >+++ b/test/sql/suite.ini > > > > >@@ -11,4 +11,3 @@ release_disabled = errinj.test.lua view_delayed_wal.test.lua sql-debug.test.lua > > > > > disabled = sql-statN-index-drop.test.lua > > > > > pretest_clean = True > > > > > fragile = dll.test.lua ; gh-4427 > > > > >- func-recreate.test.lua ; gh-4384 > > > > >-- > > > > >2.7.4 > > > > >  > > > >   > > > >   > > > > -- > > > > Alexander Tikhonov > > > >