diff options
author | Marius Bakke <marius@gnu.org> | 2022-07-21 23:52:47 +0200 |
---|---|---|
committer | Marius Bakke <marius@gnu.org> | 2022-07-21 23:52:47 +0200 |
commit | abea091dbef2d44e6eb46bd2413bdf917e14d095 (patch) | |
tree | 28f6c61dbda0acb52678944b121b66a6f50a3709 /gnu/tests | |
parent | 3b20467807c32aeac56bbbe22ffb8823f68e282b (diff) | |
parent | 3f171587bc6a47bb056f3e699e17e05f5832aea5 (diff) |
Merge branch 'master' into staging
Diffstat (limited to 'gnu/tests')
-rw-r--r-- | gnu/tests/guix.scm | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/gnu/tests/guix.scm b/gnu/tests/guix.scm index a4c3e35e5d..ad0980a10c 100644 --- a/gnu/tests/guix.scm +++ b/gnu/tests/guix.scm @@ -222,14 +222,23 @@ host all all ::1/128 trust")))))) ((pid) (number? pid)))))) marionette)) + ;; The service starts immediately but replies with status 500 until + ;; initialization is complete, so keep trying for a while. + (define (try-http-get attempts) + (let ((status + (let-values (((response text) + (http-get #$(simple-format + #f "http://localhost:~A/healthcheck" + forwarded-port)))) + (response-code response)))) + (if (or (= status 200) (<= attempts 1)) + status + (begin (sleep 5) + (try-http-get (- attempts 1)))))) + (test-equal "http-get" 200 - (let-values - (((response text) - (http-get #$(simple-format - #f "http://localhost:~A/healthcheck" forwarded-port) - #:decode-body? #t))) - (response-code response))) + (try-http-get 12)) (test-end)))) |