[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#56563] [PATCH] gnu: tests: Fix guix-data-service test.
From: |
Munyoki Kilyungi |
Subject: |
[bug#56563] [PATCH] gnu: tests: Fix guix-data-service test. |
Date: |
Fri, 15 Jul 2022 00:26:16 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) |
Timotej Lazar <timotej.lazar@araneo.si> anaandika:
[...]
> + ;; The service starts immediately but replies with status 500 until
> + ;; initialization is complete, so keep trying for a while.
> + (define* (try-http-get attempts)
Minor nitpick. This function definition does not
take any optional or key-word arguments AFAICT, so
it should be a "define" instead :)
> + (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 10) (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 10))
>
> (test-end))))
--
(Life is like a pencil that will surely run out,
but will leave the beautiful writing of life.)
(D4F09EB110177E03C28E2FE1F5BBAE1E0392253F
(hkp://keys.gnupg.net))
signature.asc
Description: PGP signature