guix-commits
[Top][All Lists]
Advanced

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

02/05: tests: Cgit test waits for /var/run/shepherd/socket.


From: Ludovic Courtès
Subject: 02/05: tests: Cgit test waits for /var/run/shepherd/socket.
Date: Sat, 20 Jan 2018 18:24:10 -0500 (EST)

civodul pushed a commit to branch master
in repository guix.

commit bc58201ec22aeb07b61dc1e482d6a57868436eef
Author: Ludovic Courtès <address@hidden>
Date:   Sun Jan 21 00:16:48 2018 +0100

    tests: Cgit test waits for /var/run/shepherd/socket.
    
    Previously tests sometimes start before the shepherd was listening,
    leading to test failures.
    
    * gnu/tests/version-control.scm (run-cgit-test)[test]: Add "shepherd
    socket ready" test.  Rename to two "service running" tests for clarity.
---
 gnu/tests/version-control.scm | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/gnu/tests/version-control.scm b/gnu/tests/version-control.scm
index 7367861..c20e599 100644
--- a/gnu/tests/version-control.scm
+++ b/gnu/tests/version-control.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017 Oleg Pykhalov <address@hidden>
-;;; Copyright © 2017 Ludovic Courtès <address@hidden>
+;;; Copyright © 2017, 2018 Ludovic Courtès <address@hidden>
 ;;; Copyright © 2017 Clément Lassieur <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -130,8 +130,25 @@ HTTP-PORT."
 
           (test-begin "cgit")
 
+          ;; XXX: Shepherd reads the config file *before* binding its control
+          ;; socket, so /var/run/shepherd/socket might not exist yet when the
+          ;; 'marionette' service is started.
+          (test-assert "shepherd socket ready"
+            (marionette-eval
+             `(begin
+                (use-modules (gnu services herd))
+                (let loop ((i 10))
+                  (cond ((file-exists? (%shepherd-socket-file))
+                         #t)
+                        ((> i 0)
+                         (sleep 1)
+                         (loop (- i 1)))
+                        (else
+                         'failure))))
+             marionette))
+
           ;; Wait for nginx to be up and running.
-          (test-eq "service running"
+          (test-eq "nginx running"
             'running!
             (marionette-eval
              '(begin
@@ -141,7 +158,7 @@ HTTP-PORT."
              marionette))
 
           ;; Wait for fcgiwrap to be up and running.
-          (test-eq "service running"
+          (test-eq "fcgiwrap running"
             'running!
             (marionette-eval
              '(begin



reply via email to

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