[Tarantool-patches] [PATCH 4/4] test: fix flaky qsync_basic.test.lua
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Thu Jul 16 23:38:13 MSK 2020
Too small timeouts were used for testing that synchronous
transactions succeed.
Follow-up #5162
---
test/replication/qsync_basic.result | 6 +++---
test/replication/qsync_basic.test.lua | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/test/replication/qsync_basic.result b/test/replication/qsync_basic.result
index b355a5c06..bd3c3cce1 100644
--- a/test/replication/qsync_basic.result
+++ b/test/replication/qsync_basic.result
@@ -96,7 +96,7 @@ old_synchro_quorum = box.cfg.replication_synchro_quorum
old_synchro_timeout = box.cfg.replication_synchro_timeout
| ---
| ...
-box.cfg{replication_synchro_quorum=2, replication_synchro_timeout=0.1}
+box.cfg{replication_synchro_quorum = 2, replication_synchro_timeout = 1000}
| ---
| ...
@@ -130,7 +130,7 @@ box.info.lsn - lsn
| - 2
| ...
-- Raise quorum so that master has to issue a ROLLBACK.
-box.cfg{replication_synchro_quorum=3}
+box.cfg{replication_synchro_quorum = 3, replication_synchro_timeout = 0.001}
| ---
| ...
t = fiber.time()
@@ -145,7 +145,7 @@ fiber.time() - t > box.cfg.replication_synchro_timeout
| ---
| - true
| ...
-box.cfg{replication_synchro_quorum=2}
+box.cfg{replication_synchro_quorum = 2, replication_synchro_timeout = 1000}
| ---
| ...
box.space.sync:insert{3}
diff --git a/test/replication/qsync_basic.test.lua b/test/replication/qsync_basic.test.lua
index 205fb0664..94235547d 100644
--- a/test/replication/qsync_basic.test.lua
+++ b/test/replication/qsync_basic.test.lua
@@ -40,7 +40,7 @@ box.schema.user.grant('guest', 'replication')
-- Set up synchronous replication options.
old_synchro_quorum = box.cfg.replication_synchro_quorum
old_synchro_timeout = box.cfg.replication_synchro_timeout
-box.cfg{replication_synchro_quorum=2, replication_synchro_timeout=0.1}
+box.cfg{replication_synchro_quorum = 2, replication_synchro_timeout = 1000}
test_run:cmd('create server replica with rpl_master=default,\
script="replication/replica.lua"')
@@ -54,12 +54,12 @@ box.space.sync:insert{1}
-- 1 for insertion, 1 for CONFIRM message.
box.info.lsn - lsn
-- Raise quorum so that master has to issue a ROLLBACK.
-box.cfg{replication_synchro_quorum=3}
+box.cfg{replication_synchro_quorum = 3, replication_synchro_timeout = 0.001}
t = fiber.time()
box.space.sync:insert{2}
-- Check that master waited for acks.
fiber.time() - t > box.cfg.replication_synchro_timeout
-box.cfg{replication_synchro_quorum=2}
+box.cfg{replication_synchro_quorum = 2, replication_synchro_timeout = 1000}
box.space.sync:insert{3}
box.space.sync:select{}
--
2.21.1 (Apple Git-122.3)
More information about the Tarantool-patches
mailing list