agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
pgsql: oauth: Add unit tests for multiplexer handling
21+ messages / 5 participants
[nested] [flat]

* pgsql: oauth: Add unit tests for multiplexer handling
@ 2025-08-08 16:07 Jacob Champion <jchampion@postgresql.org>
  2025-08-08 16:34 ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  0 siblings, 1 reply; 21+ messages in thread

From: Jacob Champion @ 2025-08-08 16:07 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

oauth: Add unit tests for multiplexer handling

To better record the internal behaviors of oauth-curl.c, add a unit test
suite for the socket and timer handling code. This is all based on TAP
and driven by our existing Test::More infrastructure.

Reviewed-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Discussion: https://postgr.es/m/CAOYmi+nDZxJHaWj9_jRSyf8uMToCADAmOfJEggsKW-kY7aUwHA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1443b6c0eaa2b464affc0c3aacb3c3bf09efcd6d

Modified Files
--------------
src/interfaces/libpq-oauth/Makefile          |  14 +
src/interfaces/libpq-oauth/meson.build       |  35 ++
src/interfaces/libpq-oauth/t/001_oauth.pl    |  24 ++
src/interfaces/libpq-oauth/test-oauth-curl.c | 527 +++++++++++++++++++++++++++
4 files changed, 600 insertions(+)



^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: pgsql: oauth: Add unit tests for multiplexer handling
  2025-08-08 16:07 pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jchampion@postgresql.org>
@ 2025-08-08 16:34 ` Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-08 16:42   ` Re: pgsql: oauth: Add unit tests for multiplexer handling Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 21+ messages in thread

From: Jacob Champion @ 2025-08-08 16:34 UTC (permalink / raw)
  To: Jacob Champion <jchampion@postgresql.org>; +Cc: pgsql-committers@lists.postgresql.org

On Fri, Aug 8, 2025 at 9:07 AM Jacob Champion <jchampion@postgresql.org> wrote:
>
> oauth: Add unit tests for multiplexer handling

Hmm, this has broken a couple of animals. Investigating.

--Jacob





^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: pgsql: oauth: Add unit tests for multiplexer handling
  2025-08-08 16:07 pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jchampion@postgresql.org>
  2025-08-08 16:34 ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
@ 2025-08-08 16:42   ` Tom Lane <tgl@sss.pgh.pa.us>
  2025-08-08 16:46     ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  0 siblings, 1 reply; 21+ messages in thread

From: Tom Lane @ 2025-08-08 16:42 UTC (permalink / raw)
  To: Jacob Champion <jacob.champion@enterprisedb.com>; +Cc: pgsql-committers@lists.postgresql.org

Jacob Champion <jacob.champion@enterprisedb.com> writes:
> Hmm, this has broken a couple of animals. Investigating.

At least on sifaka, oauth_tests should not be getting built at all,
because it doesn't use --with-libcurl nor have access to that library.
The link failure is unsurprising given that you're trying to build it
anyway.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: pgsql: oauth: Add unit tests for multiplexer handling
  2025-08-08 16:07 pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jchampion@postgresql.org>
  2025-08-08 16:34 ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-08 16:42   ` Re: pgsql: oauth: Add unit tests for multiplexer handling Tom Lane <tgl@sss.pgh.pa.us>
@ 2025-08-08 16:46     ` Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-08 16:50       ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  0 siblings, 1 reply; 21+ messages in thread

From: Jacob Champion @ 2025-08-08 16:46 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers@lists.postgresql.org

On Fri, Aug 8, 2025 at 9:42 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> At least on sifaka, oauth_tests should not be getting built at all,
> because it doesn't use --with-libcurl nor have access to that library.
> The link failure is unsurprising given that you're trying to build it
> anyway.

src/interfaces/libpq-oauth/Makefile is supposed to be skipped if
with_libcurl isn't there, though? Otherwise we'd fail to build the
`all` target, too.

Is the buildfarm client trying to build that directory explicitly?

--Jacob





^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: pgsql: oauth: Add unit tests for multiplexer handling
  2025-08-08 16:07 pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jchampion@postgresql.org>
  2025-08-08 16:34 ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-08 16:42   ` Re: pgsql: oauth: Add unit tests for multiplexer handling Tom Lane <tgl@sss.pgh.pa.us>
  2025-08-08 16:46     ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
@ 2025-08-08 16:50       ` Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-08 17:01         ` Re: pgsql: oauth: Add unit tests for multiplexer handling Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 21+ messages in thread

From: Jacob Champion @ 2025-08-08 16:50 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers@lists.postgresql.org

On Fri, Aug 8, 2025 at 9:46 AM Jacob Champion
<jacob.champion@enterprisedb.com> wrote:
> Is the buildfarm client trying to build that directory explicitly?

Ah, yeah:

>     foreach my $testdir (
>        glob(
>            "$pgsql/src/test/modules/*
>             $pgsql/src/interfaces/*
>             $pgsql/src/tools/*"
>        )
>      )

Before this commit, there was no t/ directory to get caught by the
buildfarm. We've had to work around this in past, it looks like:

> next if $testname =~ /ssl/ && !$using_ssl;

Thinking...

--Jacob





^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: pgsql: oauth: Add unit tests for multiplexer handling
  2025-08-08 16:07 pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jchampion@postgresql.org>
  2025-08-08 16:34 ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-08 16:42   ` Re: pgsql: oauth: Add unit tests for multiplexer handling Tom Lane <tgl@sss.pgh.pa.us>
  2025-08-08 16:46     ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-08 16:50       ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
@ 2025-08-08 17:01         ` Tom Lane <tgl@sss.pgh.pa.us>
  2025-08-08 17:05           ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  0 siblings, 1 reply; 21+ messages in thread

From: Tom Lane @ 2025-08-08 17:01 UTC (permalink / raw)
  To: Jacob Champion <jacob.champion@enterprisedb.com>; +Cc: pgsql-committers@lists.postgresql.org

Jacob Champion <jacob.champion@enterprisedb.com> writes:
> Before this commit, there was no t/ directory to get caught by the
> buildfarm. We've had to work around this in past, it looks like:
>> next if $testname =~ /ssl/ && !$using_ssl;

Yeah, that's a horrid kluge.  The makefiles themselves ought to
short-circuit building the test program.  I think the issue is that
we apply that short-circuit at the next makefile level up --- can
we do it in src/interfaces/libpq-oauth/Makefile itself?

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: pgsql: oauth: Add unit tests for multiplexer handling
  2025-08-08 16:07 pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jchampion@postgresql.org>
  2025-08-08 16:34 ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-08 16:42   ` Re: pgsql: oauth: Add unit tests for multiplexer handling Tom Lane <tgl@sss.pgh.pa.us>
  2025-08-08 16:46     ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-08 16:50       ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-08 17:01         ` Re: pgsql: oauth: Add unit tests for multiplexer handling Tom Lane <tgl@sss.pgh.pa.us>
@ 2025-08-08 17:05           ` Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-08 17:21             ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  0 siblings, 1 reply; 21+ messages in thread

From: Jacob Champion @ 2025-08-08 17:05 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers@lists.postgresql.org

On Fri, Aug 8, 2025 at 10:01 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Yeah, that's a horrid kluge.  The makefiles themselves ought to
> short-circuit building the test program.  I think the issue is that
> we apply that short-circuit at the next makefile level up --- can
> we do it in src/interfaces/libpq-oauth/Makefile itself?

I'm working on an ifeq test to do that, but some Meson animals are
also reporting issues:

/usr/bin/ld: test-oauth-curl.o: undefined reference to symbol
'floor@@GLIBC_2.2.5'
/usr/bin/ld: /lib/x86_64-linux-gnu/libm.so.6: error adding symbols:
DSO missing from command line
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This is not fully baked enough. I'll revert the test commit for now;
today is not the day to make other people fight a red farm.

--Jacob





^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: pgsql: oauth: Add unit tests for multiplexer handling
  2025-08-08 16:07 pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jchampion@postgresql.org>
  2025-08-08 16:34 ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-08 16:42   ` Re: pgsql: oauth: Add unit tests for multiplexer handling Tom Lane <tgl@sss.pgh.pa.us>
  2025-08-08 16:46     ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-08 16:50       ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-08 17:01         ` Re: pgsql: oauth: Add unit tests for multiplexer handling Tom Lane <tgl@sss.pgh.pa.us>
  2025-08-08 17:05           ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
@ 2025-08-08 17:21             ` Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-08 17:26               ` Re: pgsql: oauth: Add unit tests for multiplexer handling Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 21+ messages in thread

From: Jacob Champion @ 2025-08-08 17:21 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers@lists.postgresql.org

On Fri, Aug 8, 2025 at 10:05 AM Jacob Champion
<jacob.champion@enterprisedb.com> wrote:
>
> I'll revert the test commit for now;
> today is not the day to make other people fight a red farm.

Reverted.

So when I go for a followup next week... I could
1) wrap just the installcheck and check targets in ifeq
2) wrap the `all` target in addition to the above
3) wrap everything after the Makefile.global inclusion

Any preferences?

--Jacob





^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: pgsql: oauth: Add unit tests for multiplexer handling
  2025-08-08 16:07 pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jchampion@postgresql.org>
  2025-08-08 16:34 ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-08 16:42   ` Re: pgsql: oauth: Add unit tests for multiplexer handling Tom Lane <tgl@sss.pgh.pa.us>
  2025-08-08 16:46     ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-08 16:50       ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-08 17:01         ` Re: pgsql: oauth: Add unit tests for multiplexer handling Tom Lane <tgl@sss.pgh.pa.us>
  2025-08-08 17:05           ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-08 17:21             ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
@ 2025-08-08 17:26               ` Tom Lane <tgl@sss.pgh.pa.us>
  2025-08-11 22:58                 ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  0 siblings, 1 reply; 21+ messages in thread

From: Tom Lane @ 2025-08-08 17:26 UTC (permalink / raw)
  To: Jacob Champion <jacob.champion@enterprisedb.com>; +Cc: pgsql-committers@lists.postgresql.org

Jacob Champion <jacob.champion@enterprisedb.com> writes:
> So when I go for a followup next week... I could
> 1) wrap just the installcheck and check targets in ifeq
> 2) wrap the `all` target in addition to the above
> 3) wrap everything after the Makefile.global inclusion
> Any preferences?

I think it'd be advisable to keep the "clean" target doing its thing.
But I agree with disabling 'all', 'check', 'installcheck'.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: pgsql: oauth: Add unit tests for multiplexer handling
  2025-08-08 16:07 pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jchampion@postgresql.org>
  2025-08-08 16:34 ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-08 16:42   ` Re: pgsql: oauth: Add unit tests for multiplexer handling Tom Lane <tgl@sss.pgh.pa.us>
  2025-08-08 16:46     ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-08 16:50       ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-08 17:01         ` Re: pgsql: oauth: Add unit tests for multiplexer handling Tom Lane <tgl@sss.pgh.pa.us>
  2025-08-08 17:05           ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-08 17:21             ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-08 17:26               ` Re: pgsql: oauth: Add unit tests for multiplexer handling Tom Lane <tgl@sss.pgh.pa.us>
@ 2025-08-11 22:58                 ` Jacob Champion <jacob.champion@enterprisedb.com>
  0 siblings, 0 replies; 21+ messages in thread

From: Jacob Champion @ 2025-08-11 22:58 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers@lists.postgresql.org

On Fri, Aug 8, 2025 at 10:26 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I think it'd be advisable to keep the "clean" target doing its thing.

Makes sense.

> But I agree with disabling 'all', 'check', 'installcheck'.

I'm also planning to add the `install` target to that protected list
(while keeping `uninstall` outside it, by the same logic as above).

--Jacob





^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* pgsql: oauth: Add unit tests for multiplexer handling
@ 2025-08-25 16:42 Jacob Champion <jchampion@postgresql.org>
  2025-08-26 19:47 ` Re: pgsql: oauth: Add unit tests for multiplexer handling Christoph Berg <myon@debian.org>
  0 siblings, 1 reply; 21+ messages in thread

From: Jacob Champion @ 2025-08-25 16:42 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

oauth: Add unit tests for multiplexer handling

To better record the internal behaviors of oauth-curl.c, add a unit test
suite for the socket and timer handling code. This is all based on TAP
and driven by our existing Test::More infrastructure.

This commit is a replay of 1443b6c0e, which was reverted due to
buildfarm failures. Compared with that, this version protects the build
targets in the Makefile with a with_libcurl conditional, and it tweaks
the code style in 001_oauth.pl.

Reviewed-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Reviewed-by: Andrew Dunstan <andrew@dunslane.net>
Discussion: https://postgr.es/m/CAOYmi+nDZxJHaWj9_jRSyf8uMToCADAmOfJEggsKW-kY7aUwHA@mail.gmail.com
Discussion: https://postgr.es/m/CAOYmi+m=xY0P_uAzAP_884uF-GhQ3wrineGwc9AEnb6fYxVqVQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4e1e417330d42cb19c7d439cd50eea20f25c7518

Modified Files
--------------
src/interfaces/libpq-oauth/Makefile          |  36 +-
src/interfaces/libpq-oauth/meson.build       |  35 ++
src/interfaces/libpq-oauth/t/001_oauth.pl    |  24 ++
src/interfaces/libpq-oauth/test-oauth-curl.c | 527 +++++++++++++++++++++++++++
4 files changed, 618 insertions(+), 4 deletions(-)



^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: pgsql: oauth: Add unit tests for multiplexer handling
  2025-08-25 16:42 pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jchampion@postgresql.org>
@ 2025-08-26 19:47 ` Christoph Berg <myon@debian.org>
  2025-08-26 20:10   ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  0 siblings, 1 reply; 21+ messages in thread

From: Christoph Berg @ 2025-08-26 19:47 UTC (permalink / raw)
  To: Jacob Champion <jchampion@postgresql.org>; Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>; Andrew Dunstan <andrew@dunslane.net>; +Cc: pgsql-hackers@lists.postgresql.org

Re: Jacob Champion
> oauth: Add unit tests for multiplexer handling

This seems to require more linking on Debian bullseye:

20:19:29 gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -moutline-atomics -g -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC test-oauth-curl.o oauth-utils.o -L../../../src/port -L../../../src/common -L../../../src/common -lpgcommon_shlib -L../../../src/port -lpgport_shlib -L../../../src/interfaces/libpq -lpq -Wl,-z,relro -Wl,-z,now  -Wl,--as-needed   -lcurl -lm  -o oauth_tests
20:19:29 /usr/bin/ld: oauth-utils.o: undefined reference to symbol 'pthread_sigmask@@GLIBC_2.17'
20:19:29 /usr/bin/ld: /lib/aarch64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
20:19:29 collect2: error: ld returned 1 exit status

Full log:
https://jengus.postgresql.org/job/postgresql-19-binaries-snapshot/architecture=arm64,distribution=bu...

Distro releases newer than bullseye are fine.

Christoph





^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: pgsql: oauth: Add unit tests for multiplexer handling
  2025-08-25 16:42 pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jchampion@postgresql.org>
  2025-08-26 19:47 ` Re: pgsql: oauth: Add unit tests for multiplexer handling Christoph Berg <myon@debian.org>
@ 2025-08-26 20:10   ` Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-26 20:30     ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-29 12:57     ` Re: pgsql: oauth: Add unit tests for multiplexer handling Stefan Kaltenbrunner <stefan@kaltenbrunner.cc>
  0 siblings, 2 replies; 21+ messages in thread

From: Jacob Champion @ 2025-08-26 20:10 UTC (permalink / raw)
  To: Christoph Berg <myon@debian.org>; +Cc: Jacob Champion <jchampion@postgresql.org>; Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>; Andrew Dunstan <andrew@dunslane.net>; pgsql-hackers@lists.postgresql.org, "stefan@kaltenbrunner.cc" <stefan@kaltenbrunner.cc>

On Tue, Aug 26, 2025 at 12:48 PM Christoph Berg <myon@debian.org> wrote:
> This seems to require more linking on Debian bullseye:

Bleh. Thanks for the report; looks like none of the bullseye animals
in the farm are building with Curl yet.

(cc Stefan: guaibasaurus seems like it'd be a good candidate; would
you consider using --with-libcurl there?)

> 20:19:29 gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -moutline-atomics -g -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC test-oauth-curl.o oauth-utils.o -L../../../src/port -L../../../src/common -L../../../src/common -lpgcommon_shlib -L../../../src/port -lpgport_shlib -L../../../src/interfaces/libpq -lpq -Wl,-z,relro -Wl,-z,now  -Wl,--as-needed   -lcurl -lm  -o oauth_tests
> 20:19:29 /usr/bin/ld: oauth-utils.o: undefined reference to symbol 'pthread_sigmask@@GLIBC_2.17'
> 20:19:29 /usr/bin/ld: /lib/aarch64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
> 20:19:29 collect2: error: ld returned 1 exit status

Okay. So I need to pull in PTHREAD_CFLAGS/LIBS as well...

--Jacob





^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: pgsql: oauth: Add unit tests for multiplexer handling
  2025-08-25 16:42 pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jchampion@postgresql.org>
  2025-08-26 19:47 ` Re: pgsql: oauth: Add unit tests for multiplexer handling Christoph Berg <myon@debian.org>
  2025-08-26 20:10   ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
@ 2025-08-26 20:30     ` Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-26 20:44       ` Re: pgsql: oauth: Add unit tests for multiplexer handling Christoph Berg <myon@debian.org>
  1 sibling, 1 reply; 21+ messages in thread

From: Jacob Champion @ 2025-08-26 20:30 UTC (permalink / raw)
  To: Christoph Berg <myon@debian.org>; +Cc: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>; Andrew Dunstan <andrew@dunslane.net>; pgsql-hackers@lists.postgresql.org, "stefan@kaltenbrunner.cc" <stefan@kaltenbrunner.cc>

On Tue, Aug 26, 2025 at 1:10 PM Jacob Champion
<jacob.champion@enterprisedb.com> wrote:
> Okay. So I need to pull in PTHREAD_CFLAGS/LIBS as well...

Christoph, are you able to verify the attached patch fixes the build?

--Jacob

Attachments:

  [application/octet-stream] fix-bullseye.diff (838B, ../../CAOYmi+=rqBpTc9KiuBd5GqzEj+bb3J_sdwKKoQrF=XoXbQ5kXw@mail.gmail.com/2-fix-bullseye.diff)
  download | inline diff:
diff --git a/src/interfaces/libpq-oauth/Makefile b/src/interfaces/libpq-oauth/Makefile
index c8c38947ace..51145f085a8 100644
--- a/src/interfaces/libpq-oauth/Makefile
+++ b/src/interfaces/libpq-oauth/Makefile
@@ -25,6 +25,7 @@ override shlib := lib$(NAME)$(DLSUFFIX)
 override stlib := libpq-oauth.a
 
 override CPPFLAGS := -I$(libpq_srcdir) -I$(top_builddir)/src/port $(CPPFLAGS) $(LIBCURL_CPPFLAGS)
+override CFLAGS += $(PTHREAD_CFLAGS)
 
 OBJS = \
 	$(WIN32RES)
@@ -47,7 +48,7 @@ $(stlib): override OBJS += $(OBJS_STATIC)
 $(stlib): $(OBJS_STATIC)
 
 SHLIB_LINK_INTERNAL = $(libpq_pgport_shlib)
-SHLIB_LINK = $(LIBCURL_LDFLAGS) $(LIBCURL_LDLIBS) $(filter -lintl -lm, $(LIBS))
+SHLIB_LINK = $(LIBCURL_LDFLAGS) $(LIBCURL_LDLIBS) $(filter -lintl -lm $(PTHREAD_LIBS), $(LIBS))
 SHLIB_PREREQS = submake-libpq
 SHLIB_EXPORTS = exports.txt
 


^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: pgsql: oauth: Add unit tests for multiplexer handling
  2025-08-25 16:42 pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jchampion@postgresql.org>
  2025-08-26 19:47 ` Re: pgsql: oauth: Add unit tests for multiplexer handling Christoph Berg <myon@debian.org>
  2025-08-26 20:10   ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-26 20:30     ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
@ 2025-08-26 20:44       ` Christoph Berg <myon@debian.org>
  2025-08-26 21:18         ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  0 siblings, 1 reply; 21+ messages in thread

From: Christoph Berg @ 2025-08-26 20:44 UTC (permalink / raw)
  To: Jacob Champion <jacob.champion@enterprisedb.com>; +Cc: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>; Andrew Dunstan <andrew@dunslane.net>; pgsql-hackers@lists.postgresql.org, "stefan@kaltenbrunner.cc" <stefan@kaltenbrunner.cc>

Re: Jacob Champion
> On Tue, Aug 26, 2025 at 1:10 PM Jacob Champion
> <jacob.champion@enterprisedb.com> wrote:
> > Okay. So I need to pull in PTHREAD_CFLAGS/LIBS as well...
> 
> Christoph, are you able to verify the attached patch fixes the build?

The patch fixes the autoconf build here.

Thanks,
Christoph





^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: pgsql: oauth: Add unit tests for multiplexer handling
  2025-08-25 16:42 pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jchampion@postgresql.org>
  2025-08-26 19:47 ` Re: pgsql: oauth: Add unit tests for multiplexer handling Christoph Berg <myon@debian.org>
  2025-08-26 20:10   ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-26 20:30     ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-26 20:44       ` Re: pgsql: oauth: Add unit tests for multiplexer handling Christoph Berg <myon@debian.org>
@ 2025-08-26 21:18         ` Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-26 21:44           ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  0 siblings, 1 reply; 21+ messages in thread

From: Jacob Champion @ 2025-08-26 21:18 UTC (permalink / raw)
  To: Christoph Berg <myon@debian.org>; +Cc: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>; Andrew Dunstan <andrew@dunslane.net>; pgsql-hackers@lists.postgresql.org, "stefan@kaltenbrunner.cc" <stefan@kaltenbrunner.cc>

On Tue, Aug 26, 2025 at 1:45 PM Christoph Berg <myon@debian.org> wrote:
> The patch fixes the autoconf build here.

Thanks! The meson side needs an additional thread_dep as well; once
that passes CI I will push.

--Jacob





^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: pgsql: oauth: Add unit tests for multiplexer handling
  2025-08-25 16:42 pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jchampion@postgresql.org>
  2025-08-26 19:47 ` Re: pgsql: oauth: Add unit tests for multiplexer handling Christoph Berg <myon@debian.org>
  2025-08-26 20:10   ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-26 20:30     ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-26 20:44       ` Re: pgsql: oauth: Add unit tests for multiplexer handling Christoph Berg <myon@debian.org>
  2025-08-26 21:18         ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
@ 2025-08-26 21:44           ` Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-27 10:37             ` Re: pgsql: oauth: Add unit tests for multiplexer handling Christoph Berg <myon@debian.org>
  0 siblings, 1 reply; 21+ messages in thread

From: Jacob Champion @ 2025-08-26 21:44 UTC (permalink / raw)
  To: Christoph Berg <myon@debian.org>; +Cc: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>; Andrew Dunstan <andrew@dunslane.net>; pgsql-hackers@lists.postgresql.org, "stefan@kaltenbrunner.cc" <stefan@kaltenbrunner.cc>

On Tue, Aug 26, 2025 at 2:18 PM Jacob Champion
<jacob.champion@enterprisedb.com> wrote:
> Thanks! The meson side needs an additional thread_dep as well; once
> that passes CI I will push.

Committed and backpatched. Thanks again!

--Jacob





^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: pgsql: oauth: Add unit tests for multiplexer handling
  2025-08-25 16:42 pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jchampion@postgresql.org>
  2025-08-26 19:47 ` Re: pgsql: oauth: Add unit tests for multiplexer handling Christoph Berg <myon@debian.org>
  2025-08-26 20:10   ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-26 20:30     ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-26 20:44       ` Re: pgsql: oauth: Add unit tests for multiplexer handling Christoph Berg <myon@debian.org>
  2025-08-26 21:18         ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-26 21:44           ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
@ 2025-08-27 10:37             ` Christoph Berg <myon@debian.org>
  0 siblings, 0 replies; 21+ messages in thread

From: Christoph Berg @ 2025-08-27 10:37 UTC (permalink / raw)
  To: Jacob Champion <jacob.champion@enterprisedb.com>; +Cc: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>; Andrew Dunstan <andrew@dunslane.net>; pgsql-hackers@lists.postgresql.org, "stefan@kaltenbrunner.cc" <stefan@kaltenbrunner.cc>

Re: Jacob Champion
> Committed and backpatched. Thanks again!

The apt.pg.o build is already happy again, thanks!

https://jengus.postgresql.org/job/postgresql-19-binaries-snapshot/

Christoph





^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: pgsql: oauth: Add unit tests for multiplexer handling
  2025-08-25 16:42 pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jchampion@postgresql.org>
  2025-08-26 19:47 ` Re: pgsql: oauth: Add unit tests for multiplexer handling Christoph Berg <myon@debian.org>
  2025-08-26 20:10   ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
@ 2025-08-29 12:57     ` Stefan Kaltenbrunner <stefan@kaltenbrunner.cc>
  2025-09-02 15:18       ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  1 sibling, 1 reply; 21+ messages in thread

From: Stefan Kaltenbrunner @ 2025-08-29 12:57 UTC (permalink / raw)
  To: Jacob Champion <jacob.champion@enterprisedb.com>; +Cc: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>; Andrew Dunstan <andrew@dunslane.net>; pgsql-hackers@lists.postgresql.org, Christoph Berg <myon@debian.org>

On 26.08.25 22:10, Jacob Champion wrote:
> On Tue, Aug 26, 2025 at 12:48 PM Christoph Berg <myon@debian.org> wrote:
>> This seems to require more linking on Debian bullseye:
> 
> Bleh. Thanks for the report; looks like none of the bullseye animals
> in the farm are building with Curl yet.
> 
> (cc Stefan: guaibasaurus seems like it'd be a good candidate; would
> you consider using --with-libcurl there?)

done - though gaibasauris is actually on bookworm...

Stefan





^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* Re: pgsql: oauth: Add unit tests for multiplexer handling
  2025-08-25 16:42 pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jchampion@postgresql.org>
  2025-08-26 19:47 ` Re: pgsql: oauth: Add unit tests for multiplexer handling Christoph Berg <myon@debian.org>
  2025-08-26 20:10   ` Re: pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jacob.champion@enterprisedb.com>
  2025-08-29 12:57     ` Re: pgsql: oauth: Add unit tests for multiplexer handling Stefan Kaltenbrunner <stefan@kaltenbrunner.cc>
@ 2025-09-02 15:18       ` Jacob Champion <jacob.champion@enterprisedb.com>
  0 siblings, 0 replies; 21+ messages in thread

From: Jacob Champion @ 2025-09-02 15:18 UTC (permalink / raw)
  To: Stefan Kaltenbrunner <stefan@kaltenbrunner.cc>; +Cc: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>; Andrew Dunstan <andrew@dunslane.net>; pgsql-hackers@lists.postgresql.org, Christoph Berg <myon@debian.org>

On Fri, Aug 29, 2025 at 5:57 AM Stefan Kaltenbrunner
<stefan@kaltenbrunner.cc> wrote:
> done -

Thank you!

> though gaibasauris is actually on bookworm...

Oh, good to know. The system description currently says

    Debian GNU/Linux 11 (bullseye) gcc 10.2.1 x86_64

--Jacob





^ permalink  raw  reply  [nested|flat] 21+ messages in thread

* pgsql: oauth: Add unit tests for multiplexer handling
@ 2026-07-31 18:27 Jacob Champion <jchampion@postgresql.org>
  0 siblings, 0 replies; 21+ messages in thread

From: Jacob Champion @ 2026-07-31 18:27 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

oauth: Add unit tests for multiplexer handling

(This is a late cherry-pick of 4e1e41733, now that the new suite has
proven its stability, to ensure coverage for this code in PG18 as the
later branches diverge.)

To better record the internal behaviors of oauth-curl.c, add a unit test
suite for the socket and timer handling code. This is all based on TAP
and driven by our existing Test::More infrastructure.

This commit is a replay of 1443b6c0e, which was reverted due to
buildfarm failures. Compared with that, this version protects the build
targets in the Makefile with a with_libcurl conditional, and it tweaks
the code style in 001_oauth.pl.

Reviewed-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Reviewed-by: Andrew Dunstan <andrew@dunslane.net>
Discussion: https://postgr.es/m/CAOYmi+nDZxJHaWj9_jRSyf8uMToCADAmOfJEggsKW-kY7aUwHA@mail.gmail.com
Discussion: https://postgr.es/m/CAOYmi+m=xY0P_uAzAP_884uF-GhQ3wrineGwc9AEnb6fYxVqVQ@mail.gmail.com

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/fff8c86759659a070e014ffd7295e93a11a1479c

Modified Files
--------------
src/interfaces/libpq-oauth/Makefile          |  36 +-
src/interfaces/libpq-oauth/meson.build       |  35 ++
src/interfaces/libpq-oauth/t/001_oauth.pl    |  24 ++
src/interfaces/libpq-oauth/test-oauth-curl.c | 527 +++++++++++++++++++++++++++
4 files changed, 618 insertions(+), 4 deletions(-)



^ permalink  raw  reply  [nested|flat] 21+ messages in thread


end of thread, other threads:[~2026-07-31 18:27 UTC | newest]

Thread overview: 21+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-08-08 16:07 pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jchampion@postgresql.org>
2025-08-08 16:34 ` Jacob Champion <jacob.champion@enterprisedb.com>
2025-08-08 16:42   ` Tom Lane <tgl@sss.pgh.pa.us>
2025-08-08 16:46     ` Jacob Champion <jacob.champion@enterprisedb.com>
2025-08-08 16:50       ` Jacob Champion <jacob.champion@enterprisedb.com>
2025-08-08 17:01         ` Tom Lane <tgl@sss.pgh.pa.us>
2025-08-08 17:05           ` Jacob Champion <jacob.champion@enterprisedb.com>
2025-08-08 17:21             ` Jacob Champion <jacob.champion@enterprisedb.com>
2025-08-08 17:26               ` Tom Lane <tgl@sss.pgh.pa.us>
2025-08-11 22:58                 ` Jacob Champion <jacob.champion@enterprisedb.com>
2025-08-25 16:42 pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jchampion@postgresql.org>
2025-08-26 19:47 ` Christoph Berg <myon@debian.org>
2025-08-26 20:10   ` Jacob Champion <jacob.champion@enterprisedb.com>
2025-08-26 20:30     ` Jacob Champion <jacob.champion@enterprisedb.com>
2025-08-26 20:44       ` Christoph Berg <myon@debian.org>
2025-08-26 21:18         ` Jacob Champion <jacob.champion@enterprisedb.com>
2025-08-26 21:44           ` Jacob Champion <jacob.champion@enterprisedb.com>
2025-08-27 10:37             ` Christoph Berg <myon@debian.org>
2025-08-29 12:57     ` Stefan Kaltenbrunner <stefan@kaltenbrunner.cc>
2025-09-02 15:18       ` Jacob Champion <jacob.champion@enterprisedb.com>
2026-07-31 18:27 pgsql: oauth: Add unit tests for multiplexer handling Jacob Champion <jchampion@postgresql.org>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox