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 04FC52BA06 for ; Tue, 16 Apr 2019 13:35:35 -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 gjGr0UWLSMLq for ; Tue, 16 Apr 2019 13:35:34 -0400 (EDT) Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (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 B44962B9B7 for ; Tue, 16 Apr 2019 13:35:34 -0400 (EDT) From: avtikhon Subject: [tarantool-patches] [PATCH v3] test: need to wait for upstream/downstream status Date: Tue, 16 Apr 2019 20:35:27 +0300 Message-Id: <8d1537e15eb6a4f611255346f514f26b08e56856.1555436052.git.avtikhon@tarantool.org> 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: alexander.turenko@tarantool.org Cc: avtikhon , tarantool-patches@freelists.org It is needed to wait for upstream/downstream status, otherwise error occurs: [025] --- replication/show_error_on_disconnect.result Fri Apr 12 14:49:26 2019 [025] +++ replication/show_error_on_disconnect.reject Tue Apr 16 07:35:41 2019 [025] @@ -77,11 +77,12 @@ [025] ... [025] box.info.replication[other_id].upstream.status [025] --- [025] -- stopped [025] +- sync [025] ... [025] box.info.replication[other_id].upstream.message:match("Missing") [025] --- [025] -- Missing [025] +- error: '[string "return box.info.replication[other_id].upstrea..."]:1: attempt to [025] + index field ''message'' (a nil value)' [025] ... [025] test_run:cmd("switch master_quorum2") [025] --- [025] Close #4161 --- Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-4161-show_error_on_disconnect-test Issue: https://github.com/tarantool/tarantool/issues/4161 .../show_error_on_disconnect.result | 24 +++++-------------- .../show_error_on_disconnect.test.lua | 9 +++---- 2 files changed, 9 insertions(+), 24 deletions(-) diff --git a/test/replication/show_error_on_disconnect.result b/test/replication/show_error_on_disconnect.result index af082203b..662bf1ea7 100644 --- a/test/replication/show_error_on_disconnect.result +++ b/test/replication/show_error_on_disconnect.result @@ -75,13 +75,9 @@ box.space.test:select() other_id = box.info.id % 2 + 1 --- ... -box.info.replication[other_id].upstream.status +test_run:wait_upstream(other_id, 'stopped', 'Missing') --- -- stopped -... -box.info.replication[other_id].upstream.message:match("Missing") ---- -- Missing +- true ... test_run:cmd("switch master_quorum2") --- @@ -96,21 +92,13 @@ box.space.test:select() other_id = box.info.id % 2 + 1 --- ... -box.info.replication[other_id].upstream.status ---- -- follow -... -box.info.replication[other_id].upstream.message +test_run:wait_upstream(other_id, 'follow', box.NULL) --- -- null -... -box.info.replication[other_id].downstream.status ---- -- stopped +- true ... -box.info.replication[other_id].downstream.message:match("Missing") +test_run:wait_downstream(other_id, 'stopped', 'Missing') --- -- Missing +- true ... test_run:cmd("switch default") --- diff --git a/test/replication/show_error_on_disconnect.test.lua b/test/replication/show_error_on_disconnect.test.lua index 40e9dbc5e..10457e11c 100644 --- a/test/replication/show_error_on_disconnect.test.lua +++ b/test/replication/show_error_on_disconnect.test.lua @@ -30,15 +30,12 @@ box.cfg{replication = repl} require('fiber').sleep(0.1) box.space.test:select() other_id = box.info.id % 2 + 1 -box.info.replication[other_id].upstream.status -box.info.replication[other_id].upstream.message:match("Missing") +test_run:wait_upstream(other_id, 'stopped', 'Missing') test_run:cmd("switch master_quorum2") box.space.test:select() other_id = box.info.id % 2 + 1 -box.info.replication[other_id].upstream.status -box.info.replication[other_id].upstream.message -box.info.replication[other_id].downstream.status -box.info.replication[other_id].downstream.message:match("Missing") +test_run:wait_upstream(other_id, 'follow', box.NULL) +test_run:wait_downstream(other_id, 'stopped', 'Missing') test_run:cmd("switch default") -- Cleanup. test_run:drop_cluster(SERVERS) -- 2.17.1