From: avtikhon <avtikhon@tarantool.org> To: alexander.turenko@tarantool.org Cc: avtikhon <avtikhon@tarantool.org>, tarantool-patches@freelists.org Subject: [tarantool-patches] [PATCH v2] test: need to wait for upstream/downstream status Date: Tue, 16 Apr 2019 18:21:01 +0300 [thread overview] Message-ID: <517fa44913b02c8cd91efd09115e9d3bed157d58.1555428018.git.avtikhon@tarantool.org> (raw) 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 | 20 ++++++------------- .../show_error_on_disconnect.test.lua | 8 +++----- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/test/replication/show_error_on_disconnect.result b/test/replication/show_error_on_disconnect.result index af082203b..14672d3c1 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(box.info.replication[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,17 @@ box.space.test:select() other_id = box.info.id % 2 + 1 --- ... -box.info.replication[other_id].upstream.status +test_run:wait_upstream(box.info.replication[other_id], 'follow') --- -- follow +- true ... box.info.replication[other_id].upstream.message --- - null ... -box.info.replication[other_id].downstream.status +test_run:wait_downstream(box.info.replication[other_id], 'stopped', 'Missing') --- -- stopped -... -box.info.replication[other_id].downstream.message:match("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..fcbe07fec 100644 --- a/test/replication/show_error_on_disconnect.test.lua +++ b/test/replication/show_error_on_disconnect.test.lua @@ -30,15 +30,13 @@ 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(box.info.replication[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 +test_run:wait_upstream(box.info.replication[other_id], 'follow') 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_downstream(box.info.replication[other_id], 'stopped', 'Missing') test_run:cmd("switch default") -- Cleanup. test_run:drop_cluster(SERVERS) -- 2.17.1
reply other threads:[~2019-04-16 15:21 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=517fa44913b02c8cd91efd09115e9d3bed157d58.1555428018.git.avtikhon@tarantool.org \ --to=avtikhon@tarantool.org \ --cc=alexander.turenko@tarantool.org \ --cc=tarantool-patches@freelists.org \ --subject='Re: [tarantool-patches] [PATCH v2] test: need to wait for upstream/downstream status' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox