From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp45.i.mail.ru (smtp45.i.mail.ru [94.100.177.105]) (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 AA099469710 for ; Mon, 23 Nov 2020 18:42:34 +0300 (MSK) References: From: Sergey Bronnikov Message-ID: Date: Mon, 23 Nov 2020 18:42:33 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: 8bit Content-Language: en-US Subject: Re: [Tarantool-patches] [PATCH 4/4] replication: add test with change space sync mode in a loop List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy , tarantool-patches@dev.tarantool.org Thanks for review! On 21.11.2020 17:41, Vladislav Shpilevoy wrote: > Thanks for the patch! > >> +++ b/test/replication/qsync_sync_mode.result >> @@ -0,0 +1,114 @@ >> +-- test-run result file version 2 >> +env = require('test_run') >> + | --- >> + | ... >> +test_run = env.new() >> + | --- >> + | ... >> +engine = test_run:get_cfg('engine') >> + | --- >> + | ... >> +fiber = require('fiber') >> + | --- >> + | ... >> +math = require('math') >> + | --- >> + | ... >> + >> +orig_synchro_quorum = box.cfg.replication_synchro_quorum >> + | --- >> + | ... >> +orig_synchro_timeout = box.cfg.replication_synchro_timeout >> + | --- >> + | ... >> + >> +math.randomseed(os.time()) >> + | --- >> + | ... >> +random_boolean = function() \ >> + if (math.random(1, 10) > 5) then \ > In Lua we don't use () in if conditions. Also you could simply > 'return math.random(1, 10) > 5'. Agree. Also updated format of function. --- a/test/replication/qsync_sync_mode.test.lua +++ b/test/replication/qsync_sync_mode.test.lua @@ -8,12 +8,8 @@ orig_synchro_quorum = box.cfg.replication_synchro_quorum  orig_synchro_timeout = box.cfg.replication_synchro_timeout  math.randomseed(os.time()) -random_boolean = function()                                                    \ -    if (math.random(1, 10) > 5) then                                           \ -        return true                                                            \ - else \ -        return false                                                           \ - end \ +function random_boolean() \ +    return math.random(1, 10) > 5                                              \  end  box.schema.user.grant('guest', 'replication') >> + return true \ >> + else \ >> + return false \ >> + end \ >> +end