Re: Using LibPq in TAP tests via FFI - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: Using LibPq in TAP tests via FFI
Date
Msg-id CA+hUKGL5JPO-BSpbpboNPBqrfNK0X4K4GeyAEaH4w9uySAE3EQ@mail.gmail.com
Whole thread Raw
In response to Re: Using LibPq in TAP tests via FFI  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: Using LibPq in TAP tests via FFI
List pgsql-hackers
On Wed, Jul 17, 2024 at 2:27 AM Andrew Dunstan <andrew@dunslane.net> wrote:
> Here's the latest version of this patch. It removes all use of
> background_psql(). Instead it uses libpq's async interface, which seems
> to me far more robust. There is one remaining use of interactive_psql(),
> but that's reasonable as it's used for testing psql itself.

This looks really nice!  Works on my local FBSD machine.

I pushed it to CI, and mostly saw environmental problems unrelated to
the patch, but you might be interested in the ASAN failure visible in
the cores section:

https://cirrus-ci.com/task/6607915962859520

Unfortunately I can't see the interesting log messages, because it
detected that the logs were still being appended to and declined to
upload them.  I think that means there must be subprocesses not being
waited for somewhere?

> I spent yesterday creating an XS wrapper for just the 19 libpq functions
> used in Session.pm. It's pretty simple. I have it passing a very basic
> test, but haven't tried plugging it into Session.pm yet.

Neat.  I guess the libpq FFI/XS piece looks the same to the rest of
the test framework outside that module.  It does sound pretty
convenient if the patch just works™ on CI/BF without any environment
changes, which I assume must be doable because we already build XS
stuff in sr/pl/plperl.  Looking forward to trying that version.



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: [PATCH] Add additional extended protocol commands to psql: \parse and \bindx
Next
From: Peter Smith
Date:
Subject: Re: Pgoutput not capturing the generated columns