diff mbox series

[ovs-dev,2/7] ovsdb: Improve timing in cluster torture test.

Message ID 20180518213732.30912-2-blp@ovn.org
State Accepted
Headers show
Series [ovs-dev,1/7] ovsdb: Improve torture test for clusters. | expand

Commit Message

Ben Pfaff May 18, 2018, 9:37 p.m. UTC
Until now the timing in the cluster torture test has been pretty
inaccurate because it just worked by calling "sleep 1" in a loop that
did other things.  The longer those other things too, the more inaccurate
it got.

This commit changes to using a separate process for timing.  It still won't
be all that accurate but at least the timing loop doesn't try to do
anything else.

(I'm not sure how to actually get accurate timing in shell.)

Signed-off-by: Ben Pfaff <blp@ovn.org>
---
 tests/ovsdb-cluster.at | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Justin Pettit May 25, 2018, 12:03 a.m. UTC | #1
> On May 18, 2018, at 2:37 PM, Ben Pfaff <blp@ovn.org> wrote:
> 
> Until now the timing in the cluster torture test has been pretty
> inaccurate because it just worked by calling "sleep 1" in a loop that
> did other things.  The longer those other things too, the more inaccurate
> it got.

s/too/took

Acked-by: Justin Pettit <jpettit@ovn.org>

--Justin
diff mbox series

Patch

diff --git a/tests/ovsdb-cluster.at b/tests/ovsdb-cluster.at
index cc66228c6265..755fa2dc8bbf 100644
--- a/tests/ovsdb-cluster.at
+++ b/tests/ovsdb-cluster.at
@@ -149,9 +149,9 @@  ovsdb|WARN|schema: changed 2 columns in 'OVN_Southbound' database from ephemeral
     sleep 2
 
     echo "waiting for ovn-sbctl processes to exit..."
-    i=0
     phase=0
-    while :; do
+    i=0
+    (while :; do echo; sleep 1; done) | while read; do
         printf "t=%2d s:" $i
 	done=0
         for j in $(seq 0 $(expr $n1 - 1)); do
@@ -190,7 +190,6 @@  ovsdb|WARN|schema: changed 2 columns in 'OVN_Southbound' database from ephemeral
 	    ;;
 	esac
 
-        sleep 1
 	i=$(expr $i + 1)
     done
     echo "...done"