From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 5793F6EC40; Mon, 9 Aug 2021 10:42:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5793F6EC40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1628494931; bh=8pQK1bxq79Y4J06PAp1mrsmV5UDj8wCLNmALeuoocGI=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=Rz43wSvJnXHFstW1g8J2w7FEtH4xKH9an9LqHpXvPEd/H6lmL4O/KvT7A0gDqv3ro luwo6nhqRSOo2UtxsSps7+F1anA2LxvGMAdz9R32RgPjumM0eBTCkKPKpy6qFm75JP 54CyxFGX3pO4airNqATCLRsXcnZThpTikQMOI024= Received: from smtp40.i.mail.ru (smtp40.i.mail.ru [94.100.177.100]) (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 DE9946EC40 for ; Mon, 9 Aug 2021 10:42:09 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org DE9946EC40 Received: by smtp40.i.mail.ru with esmtpa (envelope-from ) id 1mCzvE-0003Sl-M7; Mon, 09 Aug 2021 10:42:09 +0300 To: v.shpilevoy@tarantool.org, gorcunov@gmail.com Date: Mon, 9 Aug 2021 10:42:05 +0300 Message-Id: <20210809074206.57564-1-sergepetrenko@tarantool.org> X-Mailer: git-send-email 2.30.1 (Apple Git-130) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD92087353F0EC44DD9D5AC6413C25DCF08CC98B8FCC5CD86F3182A05F538085040DF6CDB449703F2A81CEA635757935A605CB7F3B6DBB4C9EB4763EFC544C57280 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7FF48036FC9305502EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637BA5555A0C16230F4EA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38BBCA57AF85F7723F26F68DC49EEEDB26CE95E1035652B66C9CC7F00164DA146DAFE8445B8C89999728AA50765F7900637F6B57BC7E64490618DEB871D839B7333395957E7521B51C2DFABB839C843B9C08941B15DA834481F8AA50765F7900637F6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8B8E48D8FAA4D20A9F75ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C72045CD04223AD1549066A14D805A7A63EE0E6274E3A4FDE9C2B6934AE262D3EE7EAB7254005DCED5177E3BD826A77771E0A4E2319210D9B64D260DF9561598F01A9E91200F654B0588BE6097D4A97A98E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34AAC3D1FDB34D04885336DB1C728847535E5763FCF78D6FC0DE606B9B03E3EDFB1E4FC19A243CCFA01D7E09C32AA3244CC96EEA1684E522BE63C309A3F9FED149F94338140B71B8EE927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojbL9S8ysBdXgLWWDPkBuJc1Aas4paNdkM X-Mailru-Sender: 3B9A0136629DC9125D61937A2360A446575061802EF85995DA8FF578C824D3C7A4DA0CDA073574BD424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: [Tarantool-patches] [PATCH] replication: fix flaky gh-3055-election-promote test X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Serge Petrenko via Tarantool-patches Reply-To: Serge Petrenko Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Found the following error in our CI: [001] Test failed! Result content mismatch: [001] --- replication/gh-3055-election-promote.result Mon Aug 2 17:52:55 2021 [001] +++ var/rejects/replication/gh-3055-election-promote.reject Mon Aug 9 10:29:34 2021 [001] @@ -88,7 +88,7 @@ [001] | ... [001] assert(not box.info.ro) [001] | --- [001] - | - true [001] + | - error: assertion failed! [001] | ... [001] assert(box.info.election.term > term) [001] | --- [001] The problem was the same as in recently fixed election_qsync.test (commit 096a0a7d5e2442656d228658f89f0c7066c60b16): PROMOTE is written to WAL asynchronously, and box.ctl.promote() returns earlier than this happens. Fix the issue by waiting for the instance to become writeable. Follow-up #6034 --- https://github.com/tarantool/tarantool/tree/sp/election-promote-fix test/replication/gh-3055-election-promote.result | 4 ++-- test/replication/gh-3055-election-promote.test.lua | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/replication/gh-3055-election-promote.result b/test/replication/gh-3055-election-promote.result index 6f5af13bc..c51ee8056 100644 --- a/test/replication/gh-3055-election-promote.result +++ b/test/replication/gh-3055-election-promote.result @@ -50,7 +50,7 @@ assert(box.info.election.state == 'leader') | --- | - true | ... -assert(not box.info.ro) +test_run:wait_cond(function() return not box.info.ro end) | --- | - true | ... @@ -86,7 +86,7 @@ assert(box.info.election.state == 'leader') | --- | - true | ... -assert(not box.info.ro) +test_run:wait_cond(function() return not box.info.ro end) | --- | - true | ... diff --git a/test/replication/gh-3055-election-promote.test.lua b/test/replication/gh-3055-election-promote.test.lua index cbc3ed206..84acc24b8 100644 --- a/test/replication/gh-3055-election-promote.test.lua +++ b/test/replication/gh-3055-election-promote.test.lua @@ -24,7 +24,7 @@ assert(box.info.election.state == 'follower') term = box.info.election.term box.ctl.promote() assert(box.info.election.state == 'leader') -assert(not box.info.ro) +test_run:wait_cond(function() return not box.info.ro end) assert(box.info.election.term > term) -- Test promote when there's a live leader. @@ -35,7 +35,7 @@ assert(box.info.ro) assert(box.info.election.leader ~= 0) box.ctl.promote() assert(box.info.election.state == 'leader') -assert(not box.info.ro) +test_run:wait_cond(function() return not box.info.ro end) assert(box.info.election.term > term) -- Cleanup. -- 2.30.1 (Apple Git-130)