diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2022-04-29 16:43:52 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2022-04-29 18:07:17 +0200 |
| commit | 73eeeeafbb0765f76834b53c9fe6cf3c8f740840 (patch) | |
| tree | 5465cdbdcda8383dd3d2d636b0f991c3a741982d /gnu/tests | |
| parent | 1bb177d08401feb4370d6422f2c6fc746adc7c2a (diff) | |
tests: Avoid starting services to check whether they're running.
Fixes a regression introduced in the Shepherd 0.9.0 whereby clients can
start a service that is already being started, leading to two instances
of the process (and usually failure of the second attempt to start it).
Partly fixes <https://issues.guix.gnu.org/54786>.
Reported by Mathieu Othacehe.
* gnu/tests/version-control.scm (run-cgit-test)
["nginx running", "fcgiwrap running"]: Wail for a file/TCP port instead
of starting the service.
(run-git-http-test)["nginx running"]: Likewise.
(run-gitile-test)["nginx running"]: Likewise.
Diffstat (limited to 'gnu/tests')
| -rw-r--r-- | gnu/tests/version-control.scm | 32 |
1 files changed, 5 insertions, 27 deletions
diff --git a/gnu/tests/version-control.scm b/gnu/tests/version-control.scm index fd3dba88ba0..18c68a58f28 100644 --- a/gnu/tests/version-control.scm +++ b/gnu/tests/version-control.scm | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2017, 2018 Oleg Pykhalov <go.wigust@gmail.com> | 2 | ;;; Copyright © 2017, 2018 Oleg Pykhalov <go.wigust@gmail.com> |
| 3 | ;;; Copyright © 2017, 2018, 2020, 2021 Ludovic Courtès <ludo@gnu.org> | 3 | ;;; Copyright © 2017-2018, 2020-2022 Ludovic Courtès <ludo@gnu.org> |
| 4 | ;;; Copyright © 2017, 2018 Clément Lassieur <clement@lassieur.org> | 4 | ;;; Copyright © 2017, 2018 Clément Lassieur <clement@lassieur.org> |
| 5 | ;;; Copyright © 2018 Christopher Baines <mail@cbaines.net> | 5 | ;;; Copyright © 2018 Christopher Baines <mail@cbaines.net> |
| 6 | ;;; | 6 | ;;; |
| @@ -154,19 +154,11 @@ HTTP-PORT." | |||
| 154 | 154 | ||
| 155 | ;; Wait for nginx to be up and running. | 155 | ;; Wait for nginx to be up and running. |
| 156 | (test-assert "nginx running" | 156 | (test-assert "nginx running" |
| 157 | (marionette-eval | 157 | (wait-for-file "/var/run/nginx/pid" marionette)) |
| 158 | '(begin | ||
| 159 | (use-modules (gnu services herd)) | ||
| 160 | (start-service 'nginx)) | ||
| 161 | marionette)) | ||
| 162 | 158 | ||
| 163 | ;; Wait for fcgiwrap to be up and running. | 159 | ;; Wait for fcgiwrap to be up and running. |
| 164 | (test-assert "fcgiwrap running" | 160 | (test-assert "fcgiwrap running" |
| 165 | (marionette-eval | 161 | (wait-for-tcp-port 9000 marionette)) |
| 166 | '(begin | ||
| 167 | (use-modules (gnu services herd)) | ||
| 168 | (start-service 'fcgiwrap)) | ||
| 169 | marionette)) | ||
| 170 | 162 | ||
| 171 | ;; Make sure the PID file is created. | 163 | ;; Make sure the PID file is created. |
| 172 | (test-assert "PID file" | 164 | (test-assert "PID file" |
| @@ -272,11 +264,7 @@ HTTP-PORT." | |||
| 272 | 264 | ||
| 273 | ;; Wait for nginx to be up and running. | 265 | ;; Wait for nginx to be up and running. |
| 274 | (test-assert "nginx running" | 266 | (test-assert "nginx running" |
| 275 | (marionette-eval | 267 | (wait-for-file "/var/run/nginx/pid" marionette)) |
| 276 | '(begin | ||
| 277 | (use-modules (gnu services herd)) | ||
| 278 | (start-service 'nginx)) | ||
| 279 | marionette)) | ||
| 280 | 268 | ||
| 281 | ;; Make sure Git test repository is created. | 269 | ;; Make sure Git test repository is created. |
| 282 | (test-assert "Git test repository" | 270 | (test-assert "Git test repository" |
| @@ -486,17 +474,7 @@ HTTP-PORT." | |||
| 486 | 474 | ||
| 487 | ;; Wait for nginx to be up and running. | 475 | ;; Wait for nginx to be up and running. |
| 488 | (test-assert "nginx running" | 476 | (test-assert "nginx running" |
| 489 | (marionette-eval | 477 | (wait-for-file "/var/run/nginx/pid" marionette)) |
| 490 | '(begin | ||
| 491 | (use-modules (gnu services herd)) | ||
| 492 | (start-service 'nginx)) | ||
| 493 | marionette)) | ||
| 494 | |||
| 495 | ;; Make sure the PID file is created. | ||
| 496 | (test-assert "PID file" | ||
| 497 | (marionette-eval | ||
| 498 | '(file-exists? "/var/run/nginx/pid") | ||
| 499 | marionette)) | ||
| 500 | 478 | ||
| 501 | ;; Make sure Git test repository is created. | 479 | ;; Make sure Git test repository is created. |
| 502 | (test-assert "Git test repository" | 480 | (test-assert "Git test repository" |
