Skip to content

[CI] Run tests on AltLinux 10 #219

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

dmitry-lipetsk
Copy link
Collaborator

Changes:

  • VIRTUALENV: virtualenv is explicitly executed through ${PYTHON}

The current problems

  1. testgres/operations/helpers.py
    # Prepared pointer on function to get a name of system codepage
    _get_default_encoding_func = _make_get_default_encoding_func()

must be

    # Prepared pointer on function to get a name of system codepage
    _get_default_encoding_func = _make_get_default_encoding_func.__func__()

It is a problem of Python 3.9

  1. These tests fail:
FAILED tests/test_simple.py::TestgresTests::test_logical_replication - psycopg2.errors.ProtocolViolation: could not create replication slot "mysub": ERROR:  could not access file "pgoutput": No such file or directory
FAILED tests/test_simple.py::TestgresTests::test_logical_catchup - psycopg2.errors.ProtocolViolation: could not create replication slot "mysub": ERROR:  could not access file "pgoutput": No such file or directory
FAILED tests/test_simple_remote.py::TestgresRemoteTests::test_logical_replication - psycopg2.errors.ProtocolViolation: could not create replication slot "mysub": ERROR:  could not access file "pgoutput": No such file or directory
FAILED tests/test_simple_remote.py::TestgresRemoteTests::test_logical_catchup - psycopg2.errors.ProtocolViolation: could not create replication slot "mysub": ERROR:  could not access file "pgoutput": No such file or directory

I suggest to fix these problems in the separated commits.

Changes:
 - VIRTUALENV: virtualenv is explicitly executed through ${PYTHON}

The current problems

1) testgres/operations/helpers.py

    # Prepared pointer on function to get a name of system codepage
    _get_default_encoding_func = _make_get_default_encoding_func()

must be

    # Prepared pointer on function to get a name of system codepage
    _get_default_encoding_func = _make_get_default_encoding_func.__func__()

It is a problem of Python 3.9

2) These tests fail:

FAILED tests/test_simple.py::TestgresTests::test_logical_replication - psycopg2.errors.ProtocolViolation: could not create replication slot "mysub": ERROR:  could not access file "pgoutput": No such file or directory
FAILED tests/test_simple.py::TestgresTests::test_logical_catchup - psycopg2.errors.ProtocolViolation: could not create replication slot "mysub": ERROR:  could not access file "pgoutput": No such file or directory
FAILED tests/test_simple_remote.py::TestgresRemoteTests::test_logical_replication - psycopg2.errors.ProtocolViolation: could not create replication slot "mysub": ERROR:  could not access file "pgoutput": No such file or directory
FAILED tests/test_simple_remote.py::TestgresRemoteTests::test_logical_catchup - psycopg2.errors.ProtocolViolation: could not create replication slot "mysub": ERROR:  could not access file "pgoutput": No such file or directory

I suggest to fix these problems in the separated commits.
…3.9]

Python 3.9 does not undestand the following code:

_get_default_encoding_func = _make_get_default_encoding_func()

ERROR - TypeError: 'staticmethod' object is not callable

https://app.travis-ci.com/github/postgrespro/testgres/jobs/631402370

The code:
_get_default_encoding_func = _make_get_default_encoding_func.__func__()

is processed without problems.
This patch fixes a problem with run the following commands:

"time <set env> converage run ..."

This command does not work (on altlinux-10 with custom build of PG).

I do not know why it happened and do not know why it was working early.

"<set env> time converage run ..." works without any problems.
We manually compile and "install" PG:
 - create a symlink /usr/local/bin/pg_config
 - create a symlink /usr/lib64/libpq.so.5

Manual bild fixes the following problem:
psycopg2.errors.ProtocolViolation: could not create replication slot "mysub": ERROR:  could not access file "pgoutput": No such file or directory

Failed tests:
 - TestTestgresCommon::test_logical_replication[remote_ops]
 - TestTestgresCommon::test_logical_catchup[local_ops]
 - TestTestgresCommon::test_logical_replication[local_ops]
 - TestTestgresCommon::test_logical_catchup[remote_ops]
time is installed manually.

It fixes the following problem:
++ pg_config --bindir
+ PG_BIN=/usr/lib/postgresql/17/bin
+ time coverage run -a -m pytest -l -v -n 4 -k ''
./run_tests.sh: line 49: time: command not found
Alplinux does in creates /usr/bin/virtualenv but creates /usr/bin/virtualenv3.

Let's create the symlink /usr/bin/virtualenv -> /usr/bin/virtualenv3 and restore an usage of virtualenv in run_tests.sh.
Python environment initialization has been simplified.
AltLinux 10 does not support the sequential "time <set_env> coverage run ...".

Because this OS does not has a builtin command 'time' in bash.

https://forum.altlinux.org/index.php?topic=48342.0

We will install 'time' manually and use another command "<set_env> time coverage run ..." that works without problems but it requires to install 'time' on Ubuntu 2024.04, too.

AlpineLinux processes a new command line without any problems.
Let's avoid creating useless environment variables.
@dmitry-lipetsk
Copy link
Collaborator Author

I don't understand why, but a simple "ssh localhost" command on AltLinux (10, 11) works 6 times slower than the same command on Ubuntu or Alpine.

This is the cause of the problems.

We exclude "remote" tests until a problem with slow SSH connection has been resolved.
Installation of mc is deleted.
@dmitry-lipetsk dmitry-lipetsk merged commit 76fa94c into postgrespro:master Mar 24, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant