Subject: bug#24060: Test (tests/publish.scm) still fails after fix

From: [email-masked] (Ludovic Courtès)
Date: Thu, 28 Jul 2016 23:20:00 +0200

Hi,

Chris Marusich <[email-masked]> skribis:

> I tried running the tests against commit
> 37402ecb4379d7199dd4b3386488261938edc780, but this time the test fails
> for a different reason.  Does it succeed for you?

Yes.

Is this new failure systematic, or does it occur randomly?

> publishing /home/marusich/guix/test-tmp/store on 0.0.0.0, port 6799
> GET /z8qsg9bmmjzgfi0bbgls1wxd0wmhhm2i.narinfo
> guile: ports.c:2527: scm_i_port_iconv_descriptors: Assertion `pti->encoding_mode == SCM_PORT_ENCODING_MODE_ICONV' failed.

What version of Guile do you use?

I wonder if this could be a remnant of <http://bugs.gnu.org/19610>.
Does commenting out the “/nar/gzip/*” test hide the problem?

If so, does the patch below help?

Thanks,
Ludo’.

$ git diff HEAD
diff --git a/tests/publish.scm b/tests/publish.scm
index 4dc8075..fda0b7c 100644
--- a/tests/publish.scm
+++ b/tests/publish.scm
@@ -172,11 +172,13 @@ References: ~%"
   "bar"
   (call-with-temporary-output-file
    (lambda (temp port)
-     (let ((nar (http-get-port
-                 (publish-uri
-                  (string-append "/nar/gzip/" (basename %item))))))
-       (call-with-gzip-input-port nar
-         (cut restore-file <> temp)))
+     (let* ((nar  (http-get-port
+                   (publish-uri
+                    (string-append "/nar/gzip/" (basename %item)))))
+            (data (call-with-gzip-input-port nar
+                    get-bytevector-all))
+            (input (open-bytevector-input-port data)))
+       (restore-file input temp))
      (call-with-input-file temp read-string))))
 
 (unless (zlib-available?)