Skip to content

Problem with TestTestgresCommon::test_replicate__target_context #456

Open

Description

@dmitry-lipetsk

https://github.com/postgrespro/testgres/actions/runs/39990139492/job/120543278680

    def test_replicate__target_context(self, node_svc: PostgresNodeService):
        assert isinstance(node_svc, PostgresNodeService)
    
        with __class__.helper__get_node(node_svc) as master:
            master.init(allow_streaming=True).start()
    
            target_port = node_svc.port_manager.reserve_port()
            assert target_port != master.port
            try:
                # For local operations use an equivalent host spelling to
                # exercise source_walsender with different host strings.  A
                # remote host must keep its configured address.
                if isinstance(node_svc.os_ops, LocalOperations):
                    target_host = "localhost" if master.host != "localhost" else "127.0.0.1"
                else:
                    target_host = master.host
    
                with master.replicate(
                    target_os_ops=node_svc.os_ops,
                    target_host=target_host,
                    target_port=target_port,
                ) as replica:
                    assert type(replica) is PostgresNode
                    assert replica.os_ops is node_svc.os_ops
                    assert replica.host == target_host
                    assert replica.port == target_port
                    assert replica.port_manager is None
    
>                   replica.start()

__class__  = <class 'tests.test_testgres_common.TestTestgresCommon'>
master     = PostgresNode(name='testgres-2804cd16-975a-489c-8953-e2ffce9b1555', port=None, base_dir='/tmp/tgsn_pswn_xh7')
node_svc   = <tests.helpers.global_data.PostgresNodeService object at 0x739ba8b749e0>
replica    = PostgresNode(name='testgres-25e6fc4b-3f48-475b-b2e8-ea4b5598d3f7', port=None, base_dir='/tmp/tgsb_p9wksm1o')
self       = <tests.test_testgres_common.TestTestgresCommon object at 0x739ba77cb590>
target_host = 'localhost'
target_port = 21290

tests/test_testgres_common.py:2232: 

postresql.log:

E       
E       /tmp/tgsb_p9wksm1o/logs/postgresql.log
E       ----
E       b'2026-10-23 18:11:49.813 GMT [23230] LOG:  starting PostgreSQL 16.15 on x86_64-pc-linux-musl, compiled by gcc (Alpine 15.2.0) 15.2.0, 64-bit
2026-10-23 18:11:49.813 GMT [23230] LOG:  listening on IPv6 address "::1", port 22106
2026-10-23 18:11:49.813 GMT [23230] LOG:  could not bind IPv4 address "127.0.0.1": Address in use
2026-10-23 18:11:49.813 GMT [23230] HINT:  Is another postmaster already running on port 22106? If not, wait a few seconds and retry.
2026-10-23 18:11:49.813 GMT [23230] FATAL:  lock file "/var/run/postgresql/.s.PGSQL.22106.lock" already exists
2026-10-23 18:11:49.813 GMT [23230] HINT:  Is another postmaster (PID 23188) using socket file "/var/run/postgresql/.s.PGSQL.22106"?
2026-10-23 18:11:49.814 GMT [23230] LOG:  database system is shut down
'```

Artefacts:
[testgres--test_logs--20261023_180604-alpine-py3_12_xx-pg16_xx-id39990139492.zip](https://github.com/user-attachments/files/33892561/testgres--test_logs--20261023_180604-alpine-py3_12_xx-pg16_xx-id39990139492.zip)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ Proxy