Subject: [bug#56563] [PATCH] gnu: tests: Fix guix-data-service test.

From: Munyoki Kilyungi <[email-masked]>
Date: Fri, 15 Jul 2022 00:26:16 +0300

Timotej Lazar <[email-masked]> 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))