On 6/11/20 1:45 AM, Flavio Leitner wrote: > The test 'Check Python IDL reconnects to leader - Python3 > (leader only)' fails sometimes when the first ovsdb-server > gets killed before the others had joined the cluster. > > Fix the function ovsdb_cluster_start_idltest to wait them > to join the cluster.
Hi, Flavio. Thanks for the fix and sorry for delays. Patch seems OK, but I'm not very comfortable with the code duplication between this function and OVS_WAIT_UNTIL macro. Have you considered conversion of ovsdb_cluster_start_idltest() function into m4_define() macro so we could easily use OVS_WAIT_UNTIL inside of it? Best regards, Ilya Maximets. > > Suggested-by: Ilya Maximets <[email protected]> > Signed-off-by: Flavio Leitner <[email protected]> > --- > tests/ovsdb-idl.at | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/tests/ovsdb-idl.at b/tests/ovsdb-idl.at > index b5cbee7d9..c045e9264 100644 > --- a/tests/ovsdb-idl.at > +++ b/tests/ovsdb-idl.at > @@ -29,6 +29,17 @@ ovsdb_cluster_start_idltest () { > ovsdb-server -vraft -vconsole:warn --detach --no-chdir > --log-file=s$i.log --pidfile=s$i.pid --unixctl=s$i --remote=punix:s$i.ovsdb > ${2:+--remote=$2} s$i.db || return $? > done > on_exit 'kill `cat s*.pid`' > + for i in `seq $n`; do > + for d in `seq 1 "$OVS_CTL_TIMEOUT"`; do > + if ovs-appctl -t $(pwd)/s$i cluster/status ${schema_name} | grep -q > 'Status: cluster member'; then > + break > + fi > + sleep 1 > + done > + if ! ovs-appctl -t $(pwd)/s$i cluster/status ${schema_name} | grep -q > 'Status: cluster member'; then > + return 1 > + fi > + done > } > > # ovsdb_cluster_leader [REMOTES] [DATABASE] > _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
