meson: Adjust test timeout for Valgrind builds

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: meson: Adjust test timeout for Valgrind builds
Date: 2026-04-03 14:53:15
Message-ID: ac/UW28t39GolvPB@ip-10-97-1-34.eu-west-3.compute.internal
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

When building with -DUSE_VALGRIND, tests run significantly slower due
to Valgrind's instrumentation overhead, causing the default 1000s test's timeout
to be exceeded. Example when running the regress test suite:

"
$ meson test -C build -q --print-errorlogs --setup running --suite regress-running
regress-running - postgresql:regress-running/regress time out (After 1000 seconds)

Summary of Failures:

1/1 regress-running - postgresql:regress-running/regress TIMEOUT 1000.01s

Ok: 0
Fail: 0
Timeout: 1
"

PFA a patch that detects Valgrind builds using a compiler check, which correctly
handles USE_VALGRIND being passed via -Dc_args, CPPFLAGS or CFLAGS and increases
the test timeout to 10000s in that case.

I don't have a strong opinion on the new value. In practice, the regress
suite runs in about 30 seconds without Valgrind and in about 46 minutes with
Valgrind on my setup. Note that the timeout is per test, not for the entire
suite so that 10000s looks large enough (I tested to run the entire suite with
the patch and it did not produce any timeout).

Another option could be to disable the timeout on a Valgrind build (set timeout
to 0) but then a test could block forever.

Note that there are no changes needed for autoconf as it does not set a timeout
for the tests.

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Attachment Content-Type Size
v1-0001-meson-adjust-test-timeout-for-Valgrind-builds.patch text/x-diff 3.5 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2026-04-03 14:59:09 Re: Adding REPACK [concurrently]
Previous Message Bertrand Drouvot 2026-04-03 14:47:20 Re: Silence -Wmaybe-uninitialized warnings