[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/08: gnu: tests: Fix guix-data-service test.
From: |
guix-commits |
Subject: |
01/08: gnu: tests: Fix guix-data-service test. |
Date: |
Fri, 15 Jul 2022 05:05:47 -0400 (EDT) |
cbaines pushed a commit to branch master
in repository guix.
commit 6a2a8ca1f5560c37cdf20cbbac972db64a9dbac9
Author: Timotej Lazar <timotej.lazar@araneo.si>
AuthorDate: Fri Jul 15 07:56:06 2022 +0200
gnu: tests: Fix guix-data-service test.
Since revision 32, guix-data-service starts immediately but returns an HTTP
error code until initialization is complete. Adjust the test accordingly,
and
remove the increased startup time limit.
* gnu/services/guix.scm (guix-data-service): Use default #:pid-file-timeout.
* gnu/tests/guix.scm (guix-data-service): Retry the http-get test several
times to give the service time to initialize.
Signed-off-by: Christopher Baines <mail@cbaines.net>
---
gnu/services/guix.scm | 2 --
gnu/tests/guix.scm | 21 +++++++++++++++------
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/gnu/services/guix.scm b/gnu/services/guix.scm
index 338e027245..dac1e5841a 100644
--- a/gnu/services/guix.scm
+++ b/gnu/services/guix.scm
@@ -652,8 +652,6 @@ ca-certificates.crt file in the system profile."
#:user #$user
#:group #$group
#:pid-file "/var/run/guix-data-service/pid"
- ;; Allow time for migrations to run
- #:pid-file-timeout 120
#:environment-variables
`(,(string-append
"GUIX_LOCPATH=" #$glibc-utf8-locales "/lib/locale")
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))))
- branch master updated (9238ba5874 -> a15b769c2f), guix-commits, 2022/07/15
- 02/08: gnu: guix-data-service: Update to 0.0.1-33.ee73d2c., guix-commits, 2022/07/15
- 03/08: gnu: guix-build-coordinator: Update to 0-59.cc884ef., guix-commits, 2022/07/15
- 07/08: gnu: gmsh: Update to 4.10.5., guix-commits, 2022/07/15
- 08/08: gnu: python-pyvista: Update to 0.35.1., guix-commits, 2022/07/15
- 04/08: gnu: asymptote: Update to 2.81., guix-commits, 2022/07/15
- 06/08: gnu: gmsh: Remove trailing booleans., guix-commits, 2022/07/15
- 05/08: gnu: gmsh: Remove input labels., guix-commits, 2022/07/15
- 01/08: gnu: tests: Fix guix-data-service test.,
guix-commits <=