From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp45.i.mail.ru (smtp45.i.mail.ru [94.100.177.105]) (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 9C43B469719 for ; Sun, 6 Sep 2020 21:30:50 +0300 (MSK) From: "Alexander V. Tikhonov" Date: Sun, 6 Sep 2020 21:30:48 +0300 Message-Id: <8128e93e56c1a4b9f1289fb0a5d6396bb47eb8e5.1599416974.git.avtikhon@tarantool.org> Subject: [Tarantool-patches] [PATCH v1] test: flaky replication/gh-4606-admin-creds test List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kirill Yukhin , Serge Petrenko Cc: tarantool-patches@dev.tarantool.org On heavy loaded hosts found the following issue: [021] --- replication/gh-4606-admin-creds.result Wed Apr 15 15:47:41 2020 [021] +++ replication/gh-4606-admin-creds.reject Sun Sep 6 20:23:09 2020 [021] @@ -36,7 +36,42 @@ [021] | ... [021] i.replication[i.id % 2 + 1].upstream.status == 'follow' or i [021] | --- [021] - | - true [021] + | - version: 2.6.0-52-g71a24b9f2 [021] + | id: 2 [021] + | ro: false [021] + | uuid: 3921679b-d994-4cf0-a6ef-1f6a0d96fc79 [021] + | package: Tarantool [021] + | cluster: [021] + | uuid: f27dfdfe-2802-486a-bc47-abc83b9097cf [021] + | listen: unix/:/Users/tntmac02.tarantool.i/tnt/test/var/014_replication/replica_auth.socket-iproto [021] + | replication_anon: [021] + | count: 0 [021] + | replication: [021] + | 1: [021] + | id: 1 [021] + | uuid: a07cad18-d27f-48c4-8d56-96b17026702e [021] + | lsn: 3 [021] + | upstream: [021] + | peer: admin@unix/:/Users/tntmac02.tarantool.i/tnt/test/var/014_replication/master.socket-iproto [021] + | lag: 0.0030207633972168 [021] + | status: disconnected [021] + | idle: 0.44824500009418 [021] + | message: timed out [021] + | system_message: Operation timed out [021] + | 2: [021] + | id: 2 [021] + | uuid: 3921679b-d994-4cf0-a6ef-1f6a0d96fc79 [021] + | lsn: 0 [021] + | signature: 3 [021] + | status: running [021] + | vclock: {1: 3} [021] + | uptime: 1 [021] + | lsn: 0 [021] + | sql: [] [021] + | gc: [] [021] + | vinyl: [] [021] + | memory: [] [021] + | pid: 40326 [021] | ... [021] test_run:switch('default') [021] | --- It happened because replication upstream status check occurred too early, when it was only in 'disconnected' state. To give the replication status check routine ability to reach the needed 'follow' state, it need to wait for it using test_run:wait_upstream() routine. Closes #5233 --- Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-5233-fix-4606 Issue: https://github.com/tarantool/tarantool/issues/5233 test/replication/gh-4606-admin-creds.result | 6 +++++- test/replication/gh-4606-admin-creds.test.lua | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/test/replication/gh-4606-admin-creds.result b/test/replication/gh-4606-admin-creds.result index fc0fbff44..138e27dce 100644 --- a/test/replication/gh-4606-admin-creds.result +++ b/test/replication/gh-4606-admin-creds.result @@ -34,10 +34,14 @@ test_run:switch('replica_auth') i = box.info | --- | ... -i.replication[i.id % 2 + 1].upstream.status == 'follow' or i +replica_id = i.id % 2 + 1 + | --- + | ... +test_run:wait_upstream(replica_id, {status = 'follow'}) or i | --- | - true | ... + test_run:switch('default') | --- | - true diff --git a/test/replication/gh-4606-admin-creds.test.lua b/test/replication/gh-4606-admin-creds.test.lua index 217d46ce1..9ab74700a 100644 --- a/test/replication/gh-4606-admin-creds.test.lua +++ b/test/replication/gh-4606-admin-creds.test.lua @@ -16,7 +16,9 @@ test_run:cmd("create server replica_auth with rpl_master=default, script='replic test_run:cmd("start server replica_auth with args='admin:111 0.1'") test_run:switch('replica_auth') i = box.info -i.replication[i.id % 2 + 1].upstream.status == 'follow' or i +replica_id = i.id % 2 + 1 +test_run:wait_upstream(replica_id, {status = 'follow'}) or i + test_run:switch('default') test_run:cmd("stop server replica_auth") test_run:cmd("cleanup server replica_auth") -- 2.17.1