From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 8FB9A29FA4 for ; Wed, 10 Apr 2019 09:28:56 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DX7OwIMUlGli for ; Wed, 10 Apr 2019 09:28:56 -0400 (EDT) Received: from smtp62.i.mail.ru (smtp62.i.mail.ru [217.69.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 4787829F90 for ; Wed, 10 Apr 2019 09:28:56 -0400 (EDT) From: Alexander Turenko Subject: [tarantool-patches] [PATCH 2/4] test: increase timeouts in replication/misc Date: Wed, 10 Apr 2019 16:28:43 +0300 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org Cc: Alexander Turenko All changes are needed to eliminate sporadic fails when testing is run with, say, 30 parallel jobs. First, replication_connect_timeout is increased to 30 seconds. This parameter doesn't change meaning of the test cases. Second, increase replication_timeout from 0.01 to 0.03. We usually set it to 0.1 in tests, but a duration of the gh-3160 test case ('Send heartbeats if there are changes from a remote master only') is around 100 * replication_timeout seconds and we don't want to make this test much longer. Runs of the test case (w/o other ones that are in replication/mics.test.lua) in 30 parallel jobs show that 0.03 is enough for the gh-3160 case to pass stably and hopefully enough for the following test cases too. --- test/replication/misc.result | 43 ++++++++-------------------------- test/replication/misc.test.lua | 27 ++++++++------------- 2 files changed, 20 insertions(+), 50 deletions(-) diff --git a/test/replication/misc.result b/test/replication/misc.result index ab827c501..a5a322c81 100644 --- a/test/replication/misc.result +++ b/test/replication/misc.result @@ -100,32 +100,12 @@ SERVERS = { 'autobootstrap1', 'autobootstrap2', 'autobootstrap3' } --- ... -- Deploy a cluster. -test_run:create_cluster(SERVERS, "replication", {args="0.1"}) +test_run:create_cluster(SERVERS, "replication", {args="0.03"}) --- ... test_run:wait_fullmesh(SERVERS) --- ... -test_run:cmd("switch autobootstrap1") ---- -- true -... -test_run = require('test_run').new() ---- -... -box.cfg{replication_timeout = 0.01, replication_connect_timeout=0.01} ---- -... -test_run:cmd("switch autobootstrap2") ---- -- true -... -test_run = require('test_run').new() ---- -... -box.cfg{replication_timeout = 0.01, replication_connect_timeout=0.01} ---- -... test_run:cmd("switch autobootstrap3") --- - true @@ -133,10 +113,7 @@ test_run:cmd("switch autobootstrap3") test_run = require('test_run').new() --- ... -fiber=require('fiber') ---- -... -box.cfg{replication_timeout = 0.01, replication_connect_timeout=0.01} +fiber = require('fiber') --- ... _ = box.schema.space.create('test_timeout'):create_index('pk') @@ -146,11 +123,11 @@ test_run:cmd("setopt delimiter ';'") --- - true ... -function wait_follow(replicaA, replicaB) +function wait_not_follow(replicaA, replicaB) return test_run:wait_cond(function() return replicaA.status ~= 'follow' or replicaB.status ~= 'follow' - end, 0.01) -end ; + end, box.cfg.replication_timeout) +end; --- ... function test_timeout() @@ -158,16 +135,16 @@ function test_timeout() local replicaB = box.info.replication[3].upstream or box.info.replication[2].upstream local follows = test_run:wait_cond(function() return replicaA.status == 'follow' or replicaB.status == 'follow' - end, 0.1) - if not follows then error('replicas not in follow status') end - for i = 0, 99 do + end) + if not follows then error('replicas are not in the follow status') end + for i = 0, 99 do box.space.test_timeout:replace({1}) - if wait_follow(replicaA, replicaB) then + if wait_not_follow(replicaA, replicaB) then return error(box.info.replication) end end return true -end ; +end; --- ... test_run:cmd("setopt delimiter ''"); diff --git a/test/replication/misc.test.lua b/test/replication/misc.test.lua index eda5310b6..2ee6b5ac7 100644 --- a/test/replication/misc.test.lua +++ b/test/replication/misc.test.lua @@ -39,40 +39,33 @@ test_run:cleanup_cluster() SERVERS = { 'autobootstrap1', 'autobootstrap2', 'autobootstrap3' } -- Deploy a cluster. -test_run:create_cluster(SERVERS, "replication", {args="0.1"}) +test_run:create_cluster(SERVERS, "replication", {args="0.03"}) test_run:wait_fullmesh(SERVERS) -test_run:cmd("switch autobootstrap1") -test_run = require('test_run').new() -box.cfg{replication_timeout = 0.01, replication_connect_timeout=0.01} -test_run:cmd("switch autobootstrap2") -test_run = require('test_run').new() -box.cfg{replication_timeout = 0.01, replication_connect_timeout=0.01} test_run:cmd("switch autobootstrap3") test_run = require('test_run').new() -fiber=require('fiber') -box.cfg{replication_timeout = 0.01, replication_connect_timeout=0.01} +fiber = require('fiber') _ = box.schema.space.create('test_timeout'):create_index('pk') test_run:cmd("setopt delimiter ';'") -function wait_follow(replicaA, replicaB) +function wait_not_follow(replicaA, replicaB) return test_run:wait_cond(function() return replicaA.status ~= 'follow' or replicaB.status ~= 'follow' - end, 0.01) -end ; + end, box.cfg.replication_timeout) +end; function test_timeout() local replicaA = box.info.replication[1].upstream or box.info.replication[2].upstream local replicaB = box.info.replication[3].upstream or box.info.replication[2].upstream local follows = test_run:wait_cond(function() return replicaA.status == 'follow' or replicaB.status == 'follow' - end, 0.1) - if not follows then error('replicas not in follow status') end - for i = 0, 99 do + end) + if not follows then error('replicas are not in the follow status') end + for i = 0, 99 do box.space.test_timeout:replace({1}) - if wait_follow(replicaA, replicaB) then + if wait_not_follow(replicaA, replicaB) then return error(box.info.replication) end end return true -end ; +end; test_run:cmd("setopt delimiter ''"); test_timeout() -- 2.20.1