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 2/5] test/lib: Wait for kernel to free up ports used by iperf3 before reusing them
Date: Fri, 23 Sep 2022 02:53:24 +0200	[thread overview]
Message-ID: <20220923005327.1000042-3-sbrivio@redhat.com> (raw)
In-Reply-To: <20220923005327.1000042-1-sbrivio@redhat.com>

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

If we start another server on the same port right away, we might fail
to bind the port. A small delay appears to be needed -- I'm not
entirely sure why at this point.

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

diff --git a/test/lib/test b/test/lib/test
index 7259383..558d0f0 100755
--- a/test/lib/test
+++ b/test/lib/test
@@ -68,6 +68,8 @@ test_iperf3() {
 		'for i in $(seq 0 '${__procs}'); do rm s${i}.json; done'
 
 	TEST_ONE_subs="$(list_add_pair "${TEST_ONE_subs}" "__${__var}__" "${__bw}" )"
+
+	sleep 3		# Wait for kernel to free up ports
 }
 
 test_one_line() {
-- 
@@ -68,6 +68,8 @@ test_iperf3() {
 		'for i in $(seq 0 '${__procs}'); do rm s${i}.json; done'
 
 	TEST_ONE_subs="$(list_add_pair "${TEST_ONE_subs}" "__${__var}__" "${__bw}" )"
+
+	sleep 3		# Wait for kernel to free up ports
 }
 
 test_one_line() {
-- 
2.35.1


  parent 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 ` [PATCH 1/5] test/lib: Run also iperf3 clients in background, revert to time-based wait Stefano Brivio
2022-09-23  0:53 ` Stefano Brivio [this message]
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-3-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).