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

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Sat Nov 21 17:41:16 MSK 2020


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'.

> +        return true                                                            \
> +    else                                                                       \
> +        return false                                                           \
> +    end                                                                        \
> +end


More information about the Tarantool-patches mailing list