[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] tests/unit/test-iov: Fix timeout problem on NetBSD and OpenB
|
From: |
Daniel P . Berrangé |
|
Subject: |
Re: [PATCH] tests/unit/test-iov: Fix timeout problem on NetBSD and OpenBSD |
|
Date: |
Mon, 22 Jan 2024 15:43:59 +0000 |
|
User-agent: |
Mutt/2.2.10 (2023-03-25) |
On Mon, Jan 22, 2024 at 04:33:47PM +0100, Thomas Huth wrote:
> The test-iov code uses usleep() with small values (<= 30) in some
> nested loops with many iterations. This causes a small delay on OSes
> like Linux that have a precise sleeping mechanism, but on systems
> like NetBSD and OpenBSD, each usleep() call takes multiple microseconds,
> which then sum up in a total test time of multiple minutes!
>
> Looking at the code, the usleep() does not really seem to be necessary
> here - if not enough data could be send, we should simply always use
> select() to wait 'til we can send more. Thus remove the usleep() and
> re-arrange the code a little bit to make it more clear what is going
> on here.
>
> Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> tests/unit/test-iov.c | 20 +++++++++++---------
> 1 file changed, 11 insertions(+), 9 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|