summaryrefslogtreecommitdiff
path: root/tests/texlive.scm
diff options
context:
space:
mode:
authorMaxime Devos <maximedevos@telenet.be>2021-02-20 22:04:59 +0100
committerLudovic Courtès <ludo@gnu.org>2021-03-06 11:41:48 +0100
commitc05ceaf2b650d090cf39a048193505cb4e6bd257 (patch)
treee1468c7cd89392e1239a75ef057bbc3373f09646 /tests/texlive.scm
parent3182539875a67f5989c73c3c654fe3138bbc275c (diff)
tests: do not hard code HTTP ports
Previously, test cases could fail if some process was listening at a hard-coded port. This patch eliminates most of these potential failures, by automatically assigning an unbound port. This should allow for building multiple guix trees in parallel outside a build container, though this is currently untested. The test "home-page: Connection refused" in tests/lint.scm still hardcodes port 9999, however. * guix/tests/http.scm (http-server-can-listen?): remove now unused procedure. (%http-server-port): default to port 0, meaning the OS will automatically choose a port. (open-http-server-socket): remove the false statement claiming this procedure is exported and also return the allocated port number. (%local-url): raise an error if the port is obviously unbound. (call-with-http-server): set %http-server-port to the allocated port while the thunk is called. * tests/derivations.scm: adjust test cases to use automatically assign a port. As there is no risk of a port conflict now, do not make any tests conditional upon 'http-server-can-listen?' anymore. * tests/elpa.scm: likewise. * tests/lint.scm: likewise, and add a TODO comment about a port that is still hard-coded. * tests/texlive.scm: likewise. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'tests/texlive.scm')
-rw-r--r--tests/texlive.scm3
1 files changed, 0 insertions, 3 deletions
diff --git a/tests/texlive.scm b/tests/texlive.scm
index f7e5515c4c..a6f08046a8 100644
--- a/tests/texlive.scm
+++ b/tests/texlive.scm
@@ -69,9 +69,6 @@
(keyval (@ (value "tests") (key "topic")))
"\n null\n")))
-;; Avoid collisions with other tests.
-(%http-server-port 10200)
-
(test-equal "fetch-sxml: returns SXML for valid XML"
sxml
(with-http-server `((200 ,xml))