<HTML><BODY><div><br><br> <blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">Четверг, 16 апреля 2020, 22:18 +03:00 от Nikita Pettik <korablev@tarantool.org>:<br> <div id=""><div class="js-helper js-readmsg-msg"><style type="text/css"></style><div><div id="style_15870647321659929581_BODY">On 16 Apr 22:09, Alexander Tikhonov wrote:<br>><br>> Hi Mergen, thanks for the patch, I’ve checked it on 2.2 and it runs fine, patch LGTM.<br>><br><br>Did you verify that modified test still reproduces initial problem?<br>I hope so, but ask just in case.</div></div></div></div></blockquote></div><div>Sure, I’ve checked this test before the fix and reproduced the needed issue just before the fix. With the current fix flaky fail resolved and checking error in the test became stable.</div><div><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;"><div><div class="js-helper js-readmsg-msg"><div><div> <br>> >Четверг, 16 апреля 2020, 22:07 +03:00 от imeevma@tarantool.org:<br>> > <br>> >Closes #4384<br>> >---<br>> ><a href="https://github.com/tarantool/tarantool/issues/4384" target="_blank">https://github.com/tarantool/tarantool/issues/4384</a><br>> ><a href="https://github.com/tarantool/tarantool/tree/imeevma/gh-4384-fix-test-func-recreate" target="_blank">https://github.com/tarantool/tarantool/tree/imeevma/gh-4384-fix-test-func-recreate</a><br>> ><br>> >@ChangeLog<br>> > - Fixed flaky test sql/func-recreate.test.lua (gh-4384).<br>> ><br>> > test/sql/func-recreate.result | 19 +++++++++++--------<br>> > test/sql/func-recreate.test.lua | 11 ++++++-----<br>> > test/sql/suite.ini | 1 -<br>> > 3 files changed, 17 insertions(+), 14 deletions(-)<br>> ><br>> >diff --git a/test/sql/func-recreate.result b/test/sql/func-recreate.result<br>> >index 73fb03c..470ce5a 100644<br>> >--- a/test/sql/func-recreate.result<br>> >+++ b/test/sql/func-recreate.result<br>> >@@ -12,31 +12,34 @@ box.execute('pragma sql_default_engine=\''..engine..'\'')<br>> > fiber = require('fiber')<br>> > ---<br>> > ...<br>> >-box.internal.sql_create_function('WAITFOR', 'INT', function (n) fiber.sleep(n) return n end)<br>> >+flag = true<br>> > ---<br>> > ...<br>> >-ch = fiber.channel(1)<br>> >+box.internal.sql_create_function('WAITFOR', 'INT', function () while flag do fiber.sleep(0.01) end return 0 end)<br>> > ---<br>> > ...<br>> >-_ = fiber.create(function () ch:put(box.execute('select WAITFOR(0.2)')) end)<br>> >+ch = fiber.channel(1)<br>> > ---<br>> > ...<br>> >-fiber.sleep(0.1)<br>> >+_ = fiber.create(function () ch:put(box.execute('select WAITFOR()')) end)<br>> > ---<br>> > ...<br>> >-box.internal.sql_create_function('WAITFOR', 'INT', function (n) require('fiber').sleep(n) return n end)<br>> >+box.internal.sql_create_function('WAITFOR', 'INT', function () while flag do fiber.sleep(0.01) end return 0 end)<br>> > ---<br>> > - error: 'Failed to create function ''WAITFOR'': unable to create function due to<br>> > active statements'<br>> > ...<br>> >+flag = false<br>> >+---<br>> >+...<br>> > ch:get()<br>> > ---<br>> > - metadata:<br>> >- - name: WAITFOR(0.2)<br>> >+ - name: WAITFOR()<br>> > type: integer<br>> > rows:<br>> >- - [0.2]<br>> >+ - [0]<br>> > ...<br>> >-box.internal.sql_create_function('WAITFOR', 'INT', function (n) require('fiber').sleep(n) return n end)<br>> >+box.internal.sql_create_function('WAITFOR', 'INT', function () while flag do fiber.sleep(0.01) end return 0 end)<br>> > ---<br>> > ...<br>> >diff --git a/test/sql/func-recreate.test.lua b/test/sql/func-recreate.test.lua<br>> >index 753e9ca..d482fa9 100644<br>> >--- a/test/sql/func-recreate.test.lua<br>> >+++ b/test/sql/func-recreate.test.lua<br>> >@@ -4,14 +4,15 @@ box.execute('pragma sql_default_engine=\''..engine..'\'')<br>> > <br>> > -- Check errors during function create process<br>> > fiber = require('fiber')<br>> >-box.internal.sql_create_function('WAITFOR', 'INT', function (n) fiber.sleep(n) return n end)<br>> >+flag = true<br>> >+box.internal.sql_create_function('WAITFOR', 'INT', function () while flag do fiber.sleep(0.01) end return 0 end)<br>> > <br>> > ch = fiber.channel(1)<br>> > <br>> >-_ = fiber.create(function () ch:put(box.execute('select WAITFOR(0.2)')) end)<br>> >-fiber.sleep(0.1)<br>> >+_ = fiber.create(function () ch:put(box.execute('select WAITFOR()')) end)<br>> > <br>> >-box.internal.sql_create_function('WAITFOR', 'INT', function (n) require('fiber').sleep(n) return n end)<br>> >+box.internal.sql_create_function('WAITFOR', 'INT', function () while flag do fiber.sleep(0.01) end return 0 end)<br>> >+flag = false<br>> > ch:get()<br>> >-box.internal.sql_create_function('WAITFOR', 'INT', function (n) require('fiber').sleep(n) return n end)<br>> >+box.internal.sql_create_function('WAITFOR', 'INT', function () while flag do fiber.sleep(0.01) end return 0 end)<br>> > <br>> >diff --git a/test/sql/suite.ini b/test/sql/suite.ini<br>> >index a8664c5..cc1d641 100644<br>> >--- a/test/sql/suite.ini<br>> >+++ b/test/sql/suite.ini<br>> >@@ -11,4 +11,3 @@ release_disabled = errinj.test.lua view_delayed_wal.test.lua sql-debug.test.lua<br>> > disabled = sql-statN-index-drop.test.lua<br>> > pretest_clean = True<br>> > fragile = dll.test.lua ; gh-4427<br>> >- func-recreate.test.lua ; gh-4384<br>> >--<br>> >2.7.4<br>> > <br>> <br>> <br>> --<br>> Alexander Tikhonov<br>> </div></div></div></div></blockquote> <div> </div><div data-signature-widget="container"><div data-signature-widget="content"><div>--<br>Alexander Tikhonov</div></div></div><div> </div></div></BODY></HTML>