TAP test started using meson, can get a tcp port already used by another test.

From: Zharkov Roman <r(dot)zharkov(at)postgrespro(dot)ru>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: TAP test started using meson, can get a tcp port already used by another test.
Date: 2025-02-21 08:58:45
Message-ID: 9095888db08fd3ba715df3107f5c8601@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

We running TAP tests which operates with a lot of instances. And some of
these tests randomly fail due "address already in use". It turned out
that the meson does not set environment variable MESON_BUILD_ROOT when
running the test() function [0]. As a result each test uses its own
"portlock" directory [1]. The small TAP test 001_portlock_env_test.pl
shows the test environment variables. As we can see MESON_BUILD_ROOT is
really undefined.

Can we explicitly set the MESON_BUILD_ROOT environment variable when
running a test? With included patch for the src/tools/testwrap file,
each instance gets an unique TCP port.

Thanks!

Best regards, Roman Zharkov

[0] https://mesonbuild.com/Reference-manual_functions.html#test
[1]
https://github.com/postgres/postgres/blob/7202d72787d3b93b692feae62ee963238580c877/src/test/perl/PostgreSQL/Test/Cluster.pm#L172

Attachment Content-Type Size
testwrap.patch text/x-diff 423 bytes
001_portlock_env_test.pl text/plain 326 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhang Mingli 2025-02-21 09:11:40 Re: Inconsistency between Compression and Storage for Foreign Tables
Previous Message Hayato Kuroda (Fujitsu) 2025-02-21 08:55:11 RE: pg_recvlogical requires -d but not described on the documentation