| From: | Heikki Linnakangas <hlinnaka(at)iki(dot)fi> | 
|---|---|
| To: | Daniel Gustafsson <daniel(at)yesql(dot)se> | 
| Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> | 
| Subject: | Re: IPC::Run::time[r|out] vs our TAP tests | 
| Date: | 2024-10-31 22:18:00 | 
| Message-ID: | be09172a-07f6-41bc-a7d7-60960dc31c89@iki.fi | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
On 31/10/2024 14:27, Daniel Gustafsson wrote:
>> On 28 Oct 2024, at 11:56, Heikki Linnakangas <hlinnaka(at)iki(dot)fi> wrote:
>>
>> On 09/04/2024 20:10, Daniel Gustafsson wrote:
>>> =item $session->quit
>>> Close the session and clean up resources. Each test run must be closed with
>>> C<quit>.  Returns TRUE when the session was cleanly terminated, otherwise
>>> FALSE.  A testfailure will be issued in case the session failed to finish.
>>
>> What does "session failed to finish" mean? Does it mean the same as "not cleanly terminated", i.e. a test failure is issued whenever this returns FALSE?
> 
> It was very literally referring to the finish() method.  I've reworded the
> comment to indicated that it throws a failure in case the process returns a
> non-zero exit status to finish().
I see.
> @@ -148,7 +148,9 @@ sub _wait_connect
>  =item $session->quit
>  
>  Close the session and clean up resources. Each test run must be closed with
> -C<quit>.
> +C<quit>.  Returns TRUE when the session was cleanly terminated, otherwise
> +FALSE.  A test failure will be issued in case the session exited with a non-
> +zero exit status (the finish() method returns TRUE for 0 exit status).
I still find that confusing. What finish() method? Yes, there's a 
finish() method in IPC::Run, but that's BackgroundPsql's internal 
affair, not exposed to the callers in any other way. And why do I care 
what that finish() returns for 0 exit status? That's not visible to the 
quit method's caller.
Perhaps sommething like this:
"Close the psql session and clean up resources. Each psql session must 
be closed with C<quit> before the end of the test.
Returns TRUE if psql exited successfully (i.e. with zero exit code), 
otherwise returns FALSE and reports a test failure. "
Would that be accurate?
-- 
Heikki Linnakangas
Neon (https://neon.tech)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Melanie Plageman | 2024-10-31 22:30:02 | Re: Count and log pages set all-frozen by vacuum | 
| Previous Message | Michael Banck | 2024-10-31 21:47:16 | Re: [PATCH] New predefined role pg_manage_extensions |