public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: passt-dev@passt.top
Subject: [PATCH 1/5] test/lib: Run also iperf3 clients in background, revert to time-based wait
Date: Fri, 23 Sep 2022 02:53:23 +0200	[thread overview]
Message-ID: <20220923005327.1000042-2-sbrivio@redhat.com> (raw)
In-Reply-To: <20220923005327.1000042-1-sbrivio@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1504 bytes --]

Unfortunately, this partially counters recent efforts by David to
speed up these tests, but it looks like iperf3 clients don't reliably
terminate, in some rare cases I couldn't isolate yet.

For the moment being, reintroduce the time-based wait approach, now
using the configurable test duration, and terminate the servers at
the end of it, in case they're stuck. There's no point in keeping
the 'sleep 2' later, so drop that, and while at it, make sure that
the stuck servers have time to flush the JSON output before we use
it.

Signed-off-by: Stefano Brivio <sbrivio(a)redhat.com>
---
 test/lib/test | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/test/lib/test b/test/lib/test
index d68ade4..7259383 100755
--- a/test/lib/test
+++ b/test/lib/test
@@ -40,7 +40,7 @@ test_iperf3() {
 
 	sleep 1		# Wait for server to be ready
 
-	pane_or_context_run "${__cctx}" 				\
+	pane_or_context_run_bg "${__cctx}" 				\
 		 '('							\
 		 '	for i in $(seq 0 '${__procs}'); do'		\
 		 '		iperf3 -c '${__dest}' -p '${__port}	\
@@ -49,9 +49,12 @@ test_iperf3() {
 		 '	wait'						\
 		 ')'
 
+	sleep $((__time + 5))
+
 	# If client fails to deliver control message, tell server we're done
-	pane_or_context_run "${__sctx}" 				\
-		'sleep 2; kill -INT $(cat s*.pid); rm s*.pid'
+	pane_or_context_run "${__sctx}" 'kill -INT $(cat s*.pid); rm s*.pid'
+
+	sleep 1		# ...and wait for output to be flushed
 
 	__jval=".end.sum_received.bits_per_second"
 	for __opt in ${@}; do
-- 
@@ -40,7 +40,7 @@ test_iperf3() {
 
 	sleep 1		# Wait for server to be ready
 
-	pane_or_context_run "${__cctx}" 				\
+	pane_or_context_run_bg "${__cctx}" 				\
 		 '('							\
 		 '	for i in $(seq 0 '${__procs}'); do'		\
 		 '		iperf3 -c '${__dest}' -p '${__port}	\
@@ -49,9 +49,12 @@ test_iperf3() {
 		 '	wait'						\
 		 ')'
 
+	sleep $((__time + 5))
+
 	# If client fails to deliver control message, tell server we're done
-	pane_or_context_run "${__sctx}" 				\
-		'sleep 2; kill -INT $(cat s*.pid); rm s*.pid'
+	pane_or_context_run "${__sctx}" 'kill -INT $(cat s*.pid); rm s*.pid'
+
+	sleep 1		# ...and wait for output to be flushed
 
 	__jval=".end.sum_received.bits_per_second"
 	for __opt in ${@}; do
-- 
2.35.1


  reply	other threads:[~2022-09-23  0:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-23  0:53 [PATCH 0/5] Some more hacks and workarounds to make tests pass again Stefano Brivio
2022-09-23  0:53 ` Stefano Brivio [this message]
2022-09-23  0:53 ` [PATCH 2/5] test/lib: Wait for kernel to free up ports used by iperf3 before reusing them Stefano Brivio
2022-09-23  0:53 ` [PATCH 3/5] test/perf: Wait for neper servers in guest to be ready before starting client Stefano Brivio
2022-09-23  0:53 ` [PATCH 4/5] test/lib: Wait for DHCPv4 before starting DHCPv6 client in two_guests test Stefano Brivio
2022-09-23  2:17   ` David Gibson
2022-09-23  0:53 ` [PATCH 5/5] test/distro: Update workarounds for Ubuntu 22.04 on s390x Stefano Brivio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220923005327.1000042-2-sbrivio@redhat.com \
    --to=sbrivio@redhat.com \
    --cc=passt-dev@passt.top \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).