OVS_WAIT_UNTIL([ovs-appctl -t "`pwd`"/s1 cluster/status $schema_name | grep "Election timer: 4000"])
OVS_WAIT_UNTIL([ovs-appctl -t "`pwd`"/s2 cluster/status $schema_name | grep "Election timer: 4000"])
+# Wait until cluster is ready
+for i in `seq $n`; do
+ OVS_WAIT_WHILE([ovs-appctl -t "`pwd`"/s$i cluster/status $schema_name | grep "Leader: unknown"])
+done
+
# Latest timer should be restored after DB compact and restart.
# This is to test the install_snapshot RPC.
-# XXX: Insert data before compact, because otherwise transaction will trigger
-# busy loop after compact.
-# poll_loop|DBG|wakeup due to 0-ms timeout at ../ovsdb/trigger.c:164 (89% CPU usage)
-AT_CHECK([ovsdb-client transact unix:s1.ovsdb '[["idltest",
- {"op": "insert",
- "table": "simple",
- "row": {"i": 1}}]]'], [0], [ignore], [ignore])
-
# Compact online
for i in `seq $n`; do
AT_CHECK([ovs-appctl -t "`pwd`"/s$i ovsdb-server/compact])