<HTML><BODY><br><br><br><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">
        Суббота, 20 октября 2018, 2:24 +03:00 от Alexander Turenko <alexander.turenko@tarantool.org>:<br><br><div id=""><div class="js-helper js-readmsg-msg"><div><div id="style_15399914700000000287_BODY">Hi!<br><br>
See below.<br><br>
WBR, Alexander Turenko.<br><br>
On Fri, Oct 19, 2018 at 07:17:20PM +0300, Sergei Voronezhskii wrote:<br>
                                 > If `test_run:wait_cond()` found a not 'follow` status it returns true.<br>
> Which immediately causes an error.<br>
> <br>
> Fixes #3734<br>
> Part of #2436, #3232<br>
> ---<br>
>  test/replication/misc.result   | 17 +++++++++++------<br>
>  test/replication/misc.test.lua | 15 +++++++++------<br>
>  2 files changed, 20 insertions(+), 12 deletions(-)<br>
> <br><br>
> diff --git a/test/replication/misc.test.lua b/test/replication/misc.test.lua<br>
> index 06ad974db..3866eb3ac 100644<br>
> --- a/test/replication/misc.test.lua<br>
> +++ b/test/replication/misc.test.lua<br>
> @@ -53,15 +53,18 @@ fiber=require('fiber')<br>
>  box.cfg{replication_timeout = 0.01, replication_connect_timeout=0.01}<br>
>  _ = box.schema.space.create('test_timeout'):create_index('pk')<br>
>  test_run:cmd("setopt delimiter ';'")<br>
> +function wait_follow(replicaA, replicaB)<br>
> +    return test_run:wait_cond(function()<br>
> +        return replicaA.status ~= 'follow' or replicaB.status ~= 'follow'<br>
> +    end, 0.01)<br>
> +end ;<br>
>  function test_timeout()<br>
>      for i = 0, 99 do <br>
> +        local replicaA = box.info.replication[1].upstream or box.info.replication[2].upstream<br>
> +        local replicaB = box.info.replication[3].upstream or box.info.replication[2].upstream<br>
>          box.space.test_timeout:replace({1})<br>
> -        fiber.sleep(0.005)<br>
> -        local rinfo = box.info.replication<br>
> -        if rinfo[1].upstream and rinfo[1].upstream.status ~= 'follow' or<br>
> -           rinfo[2].upstream and rinfo[2].upstream.status ~= 'follow' or<br>
> -           rinfo[3].upstream and rinfo[3].upstream.status ~= 'follow' then<br>
> -            return error('Replication broken')<br>
> +        if wait_follow(replicaA, replicaB) then<br>
> +            return error(box.info.replication)<br><br>
AFAIU, this test case checks that replicas do not leave from 'follow'<br>
state even for a short time period. We should wait for 'follow' state<br>
before the loop and perform some amount of attemps to catch an another<br>
state. I don't sure, though. Georgy should draw the line.<br><br>
I still think correction of test cases is a developer responsibility. If<br>
you want to do it, please, discuss it with the author before. This will<br>
save us some time we spend now on those extra review iterations.<br></div></div></div></div></blockquote>We discussed with Georgy how to do it:<br>function test_timeout()<br>    local replicaA = box.info.replication[1].upstream or box.info.replication[2].upstream<br>    local replicaB = box.info.replication[3].upstream or box.info.replication[2].upstream<br>    local follows = test_run:wait_cond(function()<br>        return replicaA.status == 'follow' or replicaB.status == 'follow'<br>    end, 0.1)<br>    if not follows then error('replicas not in follow status') end<br>    for i = 0, 99 do<br>        box.space.test_timeout:replace({1})<br>        if wait_follow(replicaA, replicaB) then<br>            return error(box.info.replication)<br>        end<br>    end<br>    return true<br>end ;<br><br>Branch was updated.<br><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;"><div id=""><div class="js-helper js-readmsg-msg"><div><div id="style_15399914700000000287_BODY"><br>
>          end<br>
>      end<br>
>      return true<br>
> -- <br>
> 2.18.0<br><br></div></div></div></div></blockquote>
<br>
<br>-- <br>Sergei Voronezhskii<br></BODY></HTML>