tests: web: Explicitly wait for the HTTP port.

* gnu/tests/web.scm (run-webserver-test)["HTTP port ready"]: New test.
This commit is contained in:
Ludovic Courtès 2020-04-21 16:28:47 +02:00
parent a295a1ca29
commit aa7b3c6c0e
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5

View File

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2017, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017, 2019 Christopher Baines <mail@cbaines.net> ;;; Copyright © 2017, 2019 Christopher Baines <mail@cbaines.net>
;;; Copyright © 2017, 2018 Clément Lassieur <clement@lassieur.org> ;;; Copyright © 2017, 2018 Clément Lassieur <clement@lassieur.org>
;;; Copyright © 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr> ;;; Copyright © 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
@ -110,6 +110,9 @@ HTTP-PORT."
((pid) (number? pid)))))) ((pid) (number? pid))))))
marionette)) marionette))
(test-assert "HTTP port ready"
(wait-for-tcp-port #$forwarded-port marionette))
;; Retrieve the index.html file we put in /srv. ;; Retrieve the index.html file we put in /srv.
(test-equal "http-get" (test-equal "http-get"
'(200 #$%index.html-contents) '(200 #$%index.html-contents)