guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

04/04: tests: mpd: Remove race condition; use default MPD configuration.


From: guix-commits
Subject: 04/04: tests: mpd: Remove race condition; use default MPD configuration.
Date: Fri, 6 Nov 2020 17:34:27 -0500 (EST)

civodul pushed a commit to branch version-1.2.0
in repository guix.

commit 9909eddbc55c6cac5acccab453993cd113aa38a1
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Fri Nov 6 23:12:12 2020 +0100

    tests: mpd: Remove race condition; use default MPD configuration.
    
    * gnu/tests/audio.scm (%mpd-os): Use the default 'mpd-configuration'.
    (run-mpd-test)[test]("mpd listening"): New test.
    ("mpc connect"): Use 'system*' and 'test-equal'.
---
 gnu/tests/audio.scm | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/gnu/tests/audio.scm b/gnu/tests/audio.scm
index 8eadaf0..7bf7d4e 100644
--- a/gnu/tests/audio.scm
+++ b/gnu/tests/audio.scm
@@ -28,9 +28,7 @@
 
 (define %mpd-os
   (simple-operating-system
-   (service mpd-service-type
-            (mpd-configuration
-             (user "root")))))
+   (service mpd-service-type)))
 
 (define (run-mpd-test)
   "Run tests in %mpd-os, which has mpd running."
@@ -62,9 +60,14 @@
                 (start-service 'mpd))
              marionette))
 
-          (test-assert "mpc connect"
+          (test-assert "mpd listening"
+            ;; Wait until mpd is actually listening before spawning 'mpc'.
+            (wait-for-tcp-port 6600 marionette))
+
+          (test-equal "mpc connect"
+            0
             (marionette-eval
-             '(zero? (system #$(file-append mpd-mpc "/bin/mpc")))
+             '(system* #$(file-append mpd-mpc "/bin/mpc"))
              marionette))
 
           (test-end)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]