postgrespro / pg_probackup

Backup and recovery manager for PostgreSQL
https://postgrespro.github.io/pg_probackup/
Other
703 stars 86 forks source link

[tests] ProbackupTest::backup_node always requires valid 'node' object #631

Open dmitry-lipetsk opened 1 month ago

dmitry-lipetsk commented 1 month ago

Hello,

If I understand correctly, ProbackupTest::backup_node allows node==None when data_dir is defined (see line 1098).

On the other side, this method always calls node.port (line 1110) and this is supposes that node is valid (not None).

https://github.com/postgrespro/pg_probackup/blob/a2510f5fa1845305db5aab0e5476f403fc7a5499/tests/helpers/ptrack_helpers.py#L1091-L1112


I used a debugger to set None in node to "<some string>" in data_dir.

Expression if not node and not data_dir: said OK, but a test was finished with the following error:

        cmd_list = [
            'backup',
            '-B', backup_dir,
            '--instance={0}'.format(instance),
            # "-D", pgdata,
>           '-p', '%i' % node.port,
            '-d', datname
        ]
E       AttributeError: 'NoneType' object has no attribute 'port'

tests/helpers/ptrack_helpers.py:1110: AttributeError