GNU bug report logs -
#76081
OCI provisioning service
Previous Next
Full log
Message #191 received at 76081 <at> debbugs.gnu.org (full text, mbox):
Hi,
Giacomo Leidi <goodoldpaul <at> autistici.org> writes:
> * gnu/tests/docker.scm: Simplify %test-oci-container test case and add
> explicit timeouts to tests outcomes.
[...]
> (test-assert "docker-guile running"
> (marionette-eval
> '(begin
> (use-modules (gnu services herd))
> - (match (start-service 'docker-guile)
> - (#f #f)
> - (('service response-parts ...)
> - (match (assq-ref response-parts 'running)
> - ((pid) pid)))))
> + (wait-for-service 'docker-guile #:timeout 120)
> + #t)
You can drop the trailing '#t'.
> marionette))
>
> - (test-equal "passing host environment variables and volumes"
> - '("value" "hello")
> - (marionette-eval
> - `(begin
> - (use-modules (ice-9 popen)
> - (ice-9 rdelim))
> -
> - (define slurp
> - (lambda args
> - (let* ((port (apply open-pipe* OPEN_READ args))
> - (output (let ((line (read-line port)))
> - (if (eof-object? line)
> - ""
> - line)))
> - (status (close-pipe port)))
> - output)))
> - (let* ((response1 (slurp
> - ,(string-append #$docker-cli "/bin/docker")
> - "exec" "docker-guile"
> - "/bin/guile" "-c" "(display (getenv \"VARIABLE\"))"))
> - (response2 (slurp
> - ,(string-append #$docker-cli "/bin/docker")
> - "exec" "docker-guile"
> - "/bin/guile" "-c" "(begin (use-modules (ice-9 popen) (ice-9 rdelim))
> + (test-assert "passing host environment variables and volumes"
> + (begin
> + (define (run-test)
> + (marionette-eval
> + `(begin
> + (use-modules (ice-9 popen)
> + (ice-9 rdelim))
> +
> + (define slurp
> + (lambda args
> + (let* ((port (apply open-pipe* OPEN_READ args))
> + (output (let ((line (read-line port)))
> + (if (eof-object? line)
> + ""
> + line)))
> + (status (close-pipe port)))
> + output)))
> + (let* ((response1 (slurp
> + ,(string-append #$docker-cli "/bin/docker")
> + "exec" "docker-guile"
> + "/bin/guile" "-c" "(display (getenv \"VARIABLE\"))"))
> + (response2 (slurp
> + ,(string-append #$docker-cli "/bin/docker")
> + "exec" "docker-guile"
> + "/bin/guile" "-c" "(begin (use-modules (ice-9 popen) (ice-9 rdelim))
Please mind the 80 columns maximum width :-).
> (display (call-with-input-file \"/shared.txt\" read-line)))")))
> - (list response1 response2)))
> - marionette))
> + (list response1 response2)))
> + marionette))
> + ;; Allow services to come up on slower machines
Please use complete punctuation for standalone comments.
> + (let loop ((attempts 0))
> + (if (= attempts 60)
> + (error "Service didn't come up after more than 60 seconds")
I'm curious as to why this is necessary, given in the previous test we
wait for the docker-guile service to be ready?
--
Thanks,
Maxim
This bug report was last modified 1 day ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.