qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iotests: Stop NBD server in test 162 before starting the next one
@ 2025-02-25  7:06 Thomas Huth
  2025-02-25 20:31 ` Thomas Huth
  2025-02-27 19:14 ` Eric Blake
  0 siblings, 2 replies; 4+ messages in thread
From: Thomas Huth @ 2025-02-25  7:06 UTC (permalink / raw)
  To: Kevin Wolf, qemu-block; +Cc: Hanna Reitz, qemu-devel, Eric Blake

Test 162 recently started failing for me for no obvious reasons (I
did not spot any suspicious commits in this area), but looking in
the 162.out.bad log file, there was a suspicious message at the end:

 qemu-nbd: Cannot lock pid file: Resource temporarily unavailable

And indeed, the test starts the NBD server two times, without stopping
the first server before running the second one, so the second one can
indeed fail to lock the PID file. Thus let's make sure to stop the
first server before the test continues with the second one. With this
change, the test works fine for me again.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qemu-iotests/162 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/qemu-iotests/162 b/tests/qemu-iotests/162
index 94dae60d304..956c2c5f339 100755
--- a/tests/qemu-iotests/162
+++ b/tests/qemu-iotests/162
@@ -65,6 +65,7 @@ done
 
 $QEMU_IMG info "json:{'driver': 'nbd', 'host': 'localhost', 'port': $port}" \
     | grep '^image' | sed -e "s/$port/PORT/"
+_stop_nbd_server
 
 # This is a test for NBD's bdrv_refresh_filename() implementation: It expects
 # either host or path to be set, but it must not assume that they are set to
-- 
2.48.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] iotests: Stop NBD server in test 162 before starting the next one
  2025-02-25  7:06 [PATCH] iotests: Stop NBD server in test 162 before starting the next one Thomas Huth
@ 2025-02-25 20:31 ` Thomas Huth
  2025-02-27 19:14 ` Eric Blake
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Huth @ 2025-02-25 20:31 UTC (permalink / raw)
  To: Kevin Wolf, qemu-block
  Cc: Hanna Reitz, qemu-devel, Eric Blake, Daniel P. Berrange,
	Stefan Hajnoczi

On 25/02/2025 08.06, Thomas Huth wrote:
> Test 162 recently started failing for me for no obvious reasons (I
> did not spot any suspicious commits in this area), but looking in
> the 162.out.bad log file, there was a suspicious message at the end:
> 
>   qemu-nbd: Cannot lock pid file: Resource temporarily unavailable
> 
> And indeed, the test starts the NBD server two times, without stopping
> the first server before running the second one, so the second one can
> indeed fail to lock the PID file. Thus let's make sure to stop the
> first server before the test continues with the second one. With this
> change, the test works fine for me again.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>   tests/qemu-iotests/162 | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/tests/qemu-iotests/162 b/tests/qemu-iotests/162
> index 94dae60d304..956c2c5f339 100755
> --- a/tests/qemu-iotests/162
> +++ b/tests/qemu-iotests/162
> @@ -65,6 +65,7 @@ done
>   
>   $QEMU_IMG info "json:{'driver': 'nbd', 'host': 'localhost', 'port': $port}" \
>       | grep '^image' | sed -e "s/$port/PORT/"
> +_stop_nbd_server
>   
>   # This is a test for NBD's bdrv_refresh_filename() implementation: It expects
>   # either host or path to be set, but it must not assume that they are set to

By the way, this problem also seems to be caused by running configure with 
--enable-trace-backends=simple ... but I think stopping the previous server 
before running the next one is still a good idea.

  Thomas



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] iotests: Stop NBD server in test 162 before starting the next one
  2025-02-25  7:06 [PATCH] iotests: Stop NBD server in test 162 before starting the next one Thomas Huth
  2025-02-25 20:31 ` Thomas Huth
@ 2025-02-27 19:14 ` Eric Blake
  2025-03-04 22:42   ` Eric Blake
  1 sibling, 1 reply; 4+ messages in thread
From: Eric Blake @ 2025-02-27 19:14 UTC (permalink / raw)
  To: Thomas Huth; +Cc: Kevin Wolf, qemu-block, Hanna Reitz, qemu-devel

On Tue, Feb 25, 2025 at 08:06:50AM +0100, Thomas Huth wrote:
> Test 162 recently started failing for me for no obvious reasons (I
> did not spot any suspicious commits in this area), but looking in
> the 162.out.bad log file, there was a suspicious message at the end:
> 
>  qemu-nbd: Cannot lock pid file: Resource temporarily unavailable
> 
> And indeed, the test starts the NBD server two times, without stopping
> the first server before running the second one, so the second one can
> indeed fail to lock the PID file. Thus let's make sure to stop the
> first server before the test continues with the second one. With this
> change, the test works fine for me again.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  tests/qemu-iotests/162 | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] iotests: Stop NBD server in test 162 before starting the next one
  2025-02-27 19:14 ` Eric Blake
@ 2025-03-04 22:42   ` Eric Blake
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Blake @ 2025-03-04 22:42 UTC (permalink / raw)
  To: Thomas Huth; +Cc: Kevin Wolf, qemu-block, Hanna Reitz, qemu-devel

On Thu, Feb 27, 2025 at 01:14:12PM -0600, Eric Blake wrote:
> On Tue, Feb 25, 2025 at 08:06:50AM +0100, Thomas Huth wrote:
> > Test 162 recently started failing for me for no obvious reasons (I
> > did not spot any suspicious commits in this area), but looking in
> > the 162.out.bad log file, there was a suspicious message at the end:
> > 
> >  qemu-nbd: Cannot lock pid file: Resource temporarily unavailable
> > 
> > And indeed, the test starts the NBD server two times, without stopping
> > the first server before running the second one, so the second one can
> > indeed fail to lock the PID file. Thus let's make sure to stop the
> > first server before the test continues with the second one. With this
> > change, the test works fine for me again.
> > 
> > Signed-off-by: Thomas Huth <thuth@redhat.com>
> > ---
> >  tests/qemu-iotests/162 | 1 +
> >  1 file changed, 1 insertion(+)
> 
> Reviewed-by: Eric Blake <eblake@redhat.com>

Added to my NBD queue.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-03-04 22:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-25  7:06 [PATCH] iotests: Stop NBD server in test 162 before starting the next one Thomas Huth
2025-02-25 20:31 ` Thomas Huth
2025-02-27 19:14 ` Eric Blake
2025-03-04 22:42   ` Eric Blake

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 NNTP newsgroup(s).