From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (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 08BC3446439 for ; Sat, 7 Nov 2020 02:46:38 +0300 (MSK) From: Vladislav Shpilevoy Date: Sat, 7 Nov 2020 00:46:33 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 2/2] test: speed up election_qsync List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org, sergepetrenko@tarantool.org The test used default election timeout - 5 seconds. That made the test work at least 5 seconds when test re-election. 5 seconds to ensure the old leader is dead + some time to perform the election. Closes #5499 --- test/replication/election_qsync.result | 6 ++++++ test/replication/election_qsync.test.lua | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/test/replication/election_qsync.result b/test/replication/election_qsync.result index 086b17686..abf43201f 100644 --- a/test/replication/election_qsync.result +++ b/test/replication/election_qsync.result @@ -9,6 +9,9 @@ box.schema.user.grant('guest', 'super') old_election_mode = box.cfg.election_mode | --- | ... +old_election_timeout = box.cfg.election_timeout + | --- + | ... old_replication_synchro_timeout = box.cfg.replication_synchro_timeout | --- | ... @@ -62,6 +65,7 @@ fiber = require('fiber') -- Replication timeout is small to speed up a first election start. box.cfg{ \ election_mode = 'candidate', \ + election_timeout = 0.1, \ replication_synchro_quorum = 3, \ replication_synchro_timeout = 1000000, \ replication_timeout = 0.1, \ @@ -116,6 +120,7 @@ box.cfg{replication_synchro_timeout = 1000000} -- up notice of the old leader death. box.cfg{ \ election_mode = 'candidate', \ + election_timeout = 0.1, \ replication_timeout = 0.01, \ } | --- @@ -143,6 +148,7 @@ test_run:cmd('delete server replica') | ... box.cfg{ \ election_mode = old_election_mode, \ + election_timeout = old_election_timeout, \ replication_timeout = old_replication_timeout, \ replication = old_replication, \ replication_synchro_timeout = old_replication_synchro_timeout, \ diff --git a/test/replication/election_qsync.test.lua b/test/replication/election_qsync.test.lua index 6a80f4859..f668a9d78 100644 --- a/test/replication/election_qsync.test.lua +++ b/test/replication/election_qsync.test.lua @@ -2,6 +2,7 @@ test_run = require('test_run').new() box.schema.user.grant('guest', 'super') old_election_mode = box.cfg.election_mode +old_election_timeout = box.cfg.election_timeout old_replication_synchro_timeout = box.cfg.replication_synchro_timeout old_replication_timeout = box.cfg.replication_timeout old_replication = box.cfg.replication @@ -30,6 +31,7 @@ fiber = require('fiber') -- Replication timeout is small to speed up a first election start. box.cfg{ \ election_mode = 'candidate', \ + election_timeout = 0.1, \ replication_synchro_quorum = 3, \ replication_synchro_timeout = 1000000, \ replication_timeout = 0.1, \ @@ -59,6 +61,7 @@ box.cfg{replication_synchro_timeout = 1000000} -- up notice of the old leader death. box.cfg{ \ election_mode = 'candidate', \ + election_timeout = 0.1, \ replication_timeout = 0.01, \ } @@ -70,6 +73,7 @@ box.space.test:drop() test_run:cmd('delete server replica') box.cfg{ \ election_mode = old_election_mode, \ + election_timeout = old_election_timeout, \ replication_timeout = old_replication_timeout, \ replication = old_replication, \ replication_synchro_timeout = old_replication_synchro_timeout, \ -- 2.21.1 (Apple Git-122.3)