[Tarantool-patches] [PATCH 4/4] replication: add test with change space sync mode in a loop

Sergey Bronnikov sergeyb at tarantool.org
Mon Nov 23 18:42:33 MSK 2020


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


More information about the Tarantool-patches mailing list