guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#30701] [PATCH 3/4] tests: databases: Add a system test for PostgreS


From: Christopher Baines
Subject: [bug#30701] [PATCH 3/4] tests: databases: Add a system test for PostgreSQL.
Date: Mon, 05 Mar 2018 08:34:33 +0000
User-agent: mu4e 0.9.18; emacs 25.3.1

Clément Lassieur <address@hidden> writes:

> Christopher Baines <address@hidden> writes:
>
>> * gnu/tests/databases.scm (%postgresql-os, %test-postgresql): New variables.
>>   (run-postgresql-test): New procedure.
>> ---
>>  gnu/tests/databases.scm | 59 
>> +++++++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 59 insertions(+)
> ...
>
>> +          (test-assert "service running"
>> +            (marionette-eval
>> +             '(begin
>> +                (use-modules (gnu services herd))
>> +                (match (start-service 'postgres)
>> +                  (#f #f)
>> +                  (('service response-parts ...)
>> +                   (match (assq-ref response-parts 'running)
>> +                     ((pid) (number? pid))))))
>> +             marionette))
>
> I don't understand the point of the PID check here.  pg_ctl will ensure
> that the daemon has started (by checking its PID), so I don't think
> there is any need to redo its work.  I guess the PID you'll get here is
> the one of pg_ctl, which is probably not what you want.

Because of make-forkexec-constructor, it is the main PID as set in the
external pid file created by PostgreSQL.

> I believe that (start-service 'postgres) returning true means pg_ctl
> succeeded in its check that the daemon is running.  So this is probably
> enough:
>
>           (test-assert "service running"
>             (marionette-eval
>              '(begin
>                 (use-modules (gnu services herd))
>                 (start-service 'postgres))
>              marionette))

Sure, I'm happy with this. I'll send some new patches soonish.

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]