Skip to content

Commit f752508

Browse files
Jarno Rajahalmeblp
authored andcommitted
tests: Make ovsdb test more robust and faster.
Using sleep's is prone to runtime system dependent races, and indeed this test started consistently failing on my dev VM after an unrelated change to ovs-vswitchd. Get git of the sleeps and explicitly wait for the transaction on ovsdb1 to become visible on ovsdb2. Also fix the name of the test. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org> Tested-by: Joe Stringer <joe@ovn.org>
1 parent aced1c3 commit f752508

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/ovsdb-server.at

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,7 @@ OVSDB_SERVER_SHUTDOWN2
12131213
AT_CLEANUP
12141214

12151215
#ovsdb-server/disconnect-remote-server command
1216-
AT_SETUP([ovsbd-server/disconnect-remote-server])
1216+
AT_SETUP([ovsdb-server/disconnect-remote-server])
12171217
AT_KEYWORDS([ovsdb server replication disconnect-remote-server])
12181218
replication_schema > schema
12191219
AT_CHECK([ovsdb-tool create db1 schema], [0], [stdout], [ignore])
@@ -1231,7 +1231,8 @@ AT_CHECK([ovsdb-client transact tcp:127.0.0.1:$TCP_PORT1 \
12311231
"table": "a",
12321232
"row": {"number": 0, "name": "zero"}}]]'], [0], [stdout], [ignore],
12331233
[test ! -e pid || kill `cat pid`; test ! -e pid2 || kill `cat pid2`])
1234-
sleep 2
1234+
1235+
OVS_WAIT_UNTIL([ovsdb-client dump tcp:127.0.0.1:$TCP_PORT2 | grep zero])
12351236

12361237
AT_CHECK([ovs-appctl -t "`pwd`"/unixctl2 ovsdb-server/disconnect-remote-ovsdb-server], [0], [ignore], [ignore],
12371238
[test ! -e pid || kill `cat pid`; test ! -e pid2 || kill `cat pid2`])
@@ -1242,7 +1243,6 @@ AT_CHECK([ovsdb-client transact tcp:127.0.0.1:$TCP_PORT1 \
12421243
"table": "b",
12431244
"row": {"number": 1, "name": "one"}}]]'], [0], [stdout], [ignore],
12441245
[test ! -e pid || kill `cat pid`; test ! -e pid2 || kill `cat pid2`])
1245-
sleep 2
12461246

12471247
AT_CHECK([ovsdb-client dump tcp:127.0.0.1:$TCP_PORT1], [0], [stdout], [ignore],
12481248
[test ! -e pid || kill `cat pid`; test ! -e pid2 || kill `cat pid2`])

0 commit comments

Comments
 (0)