guix-commits
[Top][All Lists]
Advanced

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

02/02: system: tests: Use 'start-service' to wait for service.


From: Ludovic Courtès
Subject: 02/02: system: tests: Use 'start-service' to wait for service.
Date: Sun, 8 May 2016 21:55:11 +0000 (UTC)

civodul pushed a commit to branch master
in repository guix.

commit 5a555642179c5aa39849b9fbc03d7d0253e16d5c
Author: Ludovic Courtès <address@hidden>
Date:   Sun May 8 23:49:02 2016 +0200

    system: tests: Use 'start-service' to wait for service.
    
    * gnu/tests/base.scm (%test-basic-os): Use 'start-service' instead of a
    busy loop to wait for 'term-tty1'.
---
 gnu/tests/base.scm |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm
index bf2d095..0f19449 100644
--- a/gnu/tests/base.scm
+++ b/gnu/tests/base.scm
@@ -128,17 +128,13 @@ info --version")
             "root\n"
             (begin
               (marionette-control "sendkey ctrl-alt-f1" marionette)
-              ;; Wait for the 'term-tty1' service to be running
+              ;; Wait for the 'term-tty1' service to be running (using
+              ;; 'start-service' is the simplest and most reliable way to do
+              ;; that.)
               (marionette-eval
                '(begin
                   (use-modules (gnu services herd))
-
-                  (let loop ((i 0))
-                    (when (> i 10)
-                      (error "terminal service not running" 
(current-services)))
-                    (unless (memq 'term-tty1 (current-services))
-                      (sleep 1)
-                      (loop (+ i 1)))))
+                  (start-service 'term-tty1))
                marionette)
 
               ;; Now we can type.



reply via email to

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