mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-05-28 03:51:53 +02:00
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.
This commit is contained in:
+5
-4
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user