Re: Improve error handling in test modules: test_extensible, test_bitmapset

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Greg Burd <greg(at)burd(dot)me>
Cc: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, aleksander(at)tigerdata(dot)com
Subject: Re: Improve error handling in test modules: test_extensible, test_bitmapset
Date: 2026-09-08 23:35:03
Message-ID: aqCbpyjfjJWXNYTx@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Sep 08, 2026 at 12:16:36PM -0400, Greg Burd wrote:
> +1, and for test_bitmapset there's a concrete reason it's safe: every
> SQL wrapper decodes through the same PG_ARG_GETBITMAPSET ->
> text_to_bitmapset() path, 48 call sites, and there's no second decode
> route. So one function exercises the whole thing and the rest is
> duplicate coverage. I'd fold test_bms_copy('{VAR}') into
> test_bms_num_members() with the others.

FWIW, I'm also finding the addition of readBitmapset() in
test_bitmapset() kind of ugly to rely on. I'd rather keep to zero
the number of calls outside readfuncs.c, as this is historically a
function kept for compatibility with external code, more efficient
than nodeRead(). I was tempted to eliminate it from src/include/ a
couple of weeks ago, until Matthias' arguments convinced me otherwise
so they have been moved to readfuncs.h instead, as there is still some
external code using it.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2026-09-08 23:46:40 Re: pg_stat_progress_cluster: do not default to CLUSTER
Previous Message Michael Paquier 2026-09-08 23:28:06 Re: [PATCH] Report userid to PgBackendStatus for standalone backends