Re: pg_regress: schedule multi-line test groups

From: Alexandre Felipe <o(dot)alexandre(dot)felipe(at)gmail(dot)com>
To: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Daniel Gustafsson <daniel(at)yesql(dot)se>, Michael Paquier <michael(at)paquier(dot)xyz>
Subject: Re: pg_regress: schedule multi-line test groups
Date: 2026-11-18 08:25:32
Message-ID: CAE8JnxMjrm2mf9a7SrgOr=ZqKu_cxDDkzMvD8E_=7jzSxO4vfQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 16, 2026 at 7:46 PM Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
wrote:

> 1. Now with 2.3:
>
> $ pg_regress ... --schedule=s --max-concurrent-tests=0
> # in schedule file "s" line 1, test a: max concurrency (0) exceeded
> Bail out!
>
> While --help still says that 0 means unlimited. (and
> --max-concurrent-tests=abc is also 0, but that's a different issue)
>

Now,
regress$ ./pg_regress --schedule=parallel_schedule --max-concurrent-tests=0
# --max-concurrent-tests=0 expected to be integer in range 1-100
Bail out!%

regress$ ./pg_regress --schedule=parallel_schedule --max-concurrent-tests=x
# --max-concurrent-tests=x expected to be integer in range 1-100
Bail out!%

regress$ ./pg_regress --schedule=parallel_schedule
--max-concurrent-tests=101
# --max-concurrent-tests=101 expected to be integer in range 1-100
Bail out!%

regress$ ./pg_regress --schedule=parallel_schedule
--max-concurrent-tests=100
# using postmaster on Unix socket, default port

regress$ ./pg_regress --help
...
--max-concurrent-tests=N maximum number of concurrent tests in
schedule
default: 100

2. long commented out lines can run tests
>
> test:
> a
> # xxxx...(1019 x)...xxxx b
>
> "All 2 tests passed"
>

Fixing (this was an old bug).

sizeof(scbuf) = 1024, so maximum line length is 1022.
this has to handle two cases: (i) in the middle of the file
the string can be 1023 long including a final line separator
(ii) the last line doesn't have a \n separator, and can't be
1023 long. Since fgets stops when the buffer it will read at
most 1023 bytes, 1 byte is reserved for the null terminator

+/*
> + * Maximum supported number of concurrent tests
> + */
> +#define MAX_PARALLEL_TESTS 100
>
> This is now defined twice.
>

Ups, I think I removed now...

---
Alexandre Felipe

Attachment Content-Type Size
v2.4-0001-pg_regress-multi-line-test-groups.patch application/octet-stream 18.8 KB
v2.4-0002-pg_regress-report-group-effective-concurrency.patch application/octet-stream 2.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Jones 2026-11-18 08:26:56 Fix ISSN output truncation when the issue code is nonzero
Previous Message Amit Kapila 2026-11-18 08:22:03 Re: Document prepared transaction lock waits with two_phase subscriptions