guix-commits
[Top][All Lists]
Advanced

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

05/05: tests: dicod: Bail out if we cannot connect within 20 seconds.


From: Ludovic Courtès
Subject: 05/05: tests: dicod: Bail out if we cannot connect within 20 seconds.
Date: Sat, 15 Apr 2017 18:48:31 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit cbe0af11b2bffb1ef534941ac29d1384c9f09549
Author: Ludovic Courtès <address@hidden>
Date:   Sun Apr 16 00:16:33 2017 +0200

    tests: dicod: Bail out if we cannot connect within 20 seconds.
    
    * gnu/tests/dict.scm (run-dicod-test)["connect inside"]: Bail out after
    20 seconds of failure to connect.
---
 gnu/tests/dict.scm | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gnu/tests/dict.scm b/gnu/tests/dict.scm
index f7a48ab..16b6edb 100644
--- a/gnu/tests/dict.scm
+++ b/gnu/tests/dict.scm
@@ -97,15 +97,16 @@
                '(begin
                   (use-modules (ice-9 rdelim))
                   (let ((sock (socket PF_INET SOCK_STREAM 0)))
-                    (let loop ()
-                      (pk 'try)
+                    (let loop ((i 0))
+                      (pk 'try i)
                       (catch 'system-error
                         (lambda ()
                           (connect sock AF_INET INADDR_LOOPBACK 2628))
                         (lambda args
                           (pk 'connection-error args)
-                          (sleep 1)
-                          (loop))))
+                          (when (< i 20)
+                            (sleep 1)
+                            (loop (+ 1 i))))))
                     (read-line sock 'concat)))
                marionette))
 



reply via email to

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