On 9/25/26 12:12 PM, Timothy Redaelli via dev wrote:
> The last two transactions of the "disruptive server with the old term
> and outdated log" test are checked on every server as soon as the
> leader replied.  A successful transaction reply only guarantees that
> the entry was committed by a majority; a follower may not have learned
> the new commit index and applied the entry yet.  The test then reads
> stale data with --no-leader-only and fails:
> 
>   ./ovsdb-cluster.at:1104: ovs-vsctl --db=unix:s$i.ovsdb --no-leader-only \
>       --bare --columns=type list QoS | grep . | sort | tr -d '\n'
>     @@ -1 +1 @@
>     -lmxyz
>     +lxyz
> 
> Wait for the data with OVS_WAIT_UNTIL instead of reading it once.
> 
> Fixes: 5d1fa6e4a4b0 ("ovsdb-cluster.at: Test disruptive server with outdated 
> log and term.")
> Signed-off-by: Timothy Redaelli <[email protected]>
> ---
> Changes since v2:
>  - Keep the compact expected output (Ilya).  Use OVS_WAIT_UNTIL with
>    test, since OVS_WAIT_UNTIL_EQUAL adds a trailing newline to the
>    expected output and can't match the tr -d '\n' result.

The 'test' construct hides the actual result on failure, it is better
to be avoided.  Adding something like sed '$a\' to the end of the
pipeline can solve the trailing newline issue.

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to