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 2D3552AD66 for ; Tue, 16 Apr 2019 02:01:59 -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 fL8F-iQSvn9P for ; Tue, 16 Apr 2019 02:01:59 -0400 (EDT) Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (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 DD7B12AD31 for ; Tue, 16 Apr 2019 02:01:58 -0400 (EDT) From: avtikhon Subject: [tarantool-patches] [PATCH v1] Add the common routine to check streams status Date: Tue, 16 Apr 2019 09:01:55 +0300 Message-Id: <5b9d82c550f76a44a43a63b397e05d1e458308e1.1555394501.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 Cc: avtikhon , tarantool-patches@freelists.org Added the common routine that checks the upstream and downstream status. Close #158 --- test_run.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test_run.lua b/test_run.lua index 42d5e56..01ebcda 100644 --- a/test_run.lua +++ b/test_run.lua @@ -227,6 +227,18 @@ local function switch(self, node) return self:cmd(switch_cmd3:format(node)) end +local function wait_id(self, id, status) + return self:wait_cond(function() return id.status == status end) or id.status +end + +local function wait_downstream(self, id, status) + return self:wait_id(id.downstream, status) +end + +local function wait_upstream(self, id, status) + return self:wait_id(id.upstream, status) +end + local get_cfg_cmd = 'config %s' local function get_cfg(self, name) @@ -360,6 +372,9 @@ local inspector_methods = { wait_fullmesh = wait_fullmesh, get_cluster_vclock = get_cluster_vclock, wait_cluster_vclock = wait_cluster_vclock, + wait_id = wait_id, + wait_downstream = wait_downstream, + wait_upstream = wait_upstream, -- grep_log = grep_log, wait_cond = wait_cond, -- 2.17.1