Skip to content
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

Regression test failure with PG15: test_ssl_attribute AssertionError: 'OpenSSL' is not None #1506

Closed
df7cb opened this issue Oct 5, 2022 · 10 comments

Comments

@df7cb
Copy link
Contributor

df7cb commented Oct 5, 2022

Hi, running the regression tests for psycopg2 2.9.3 on Debian unstable against PG15rc2 yields this:

LANG=C.UTF-8 LC_ALL=C.UTF-8 PSYCOPG2_TESTDB_HOST=localhost PSYCOPG2_TESTDB=postgres PSYCOPG2_TEST_FAST=1 pg_virtualenv -v 15 python3.10 -c import tests; tests.unittest.main(defaultTest='tests.test_suite') --verbose
...
16:36:40 test_server_version (tests.test_connection.TestConnectionInfo) ... ok
16:36:40 test_socket (tests.test_connection.TestConnectionInfo) ... ok
16:36:40 test_ssl_attribute (tests.test_connection.TestConnectionInfo) ... FAIL
16:36:40 test_ssl_in_use (tests.test_connection.TestConnectionInfo) ... ok
16:36:40 test_ssl_not_supported (tests.test_connection.TestConnectionInfo) ... skipped 'skipped because libpq 140004'
...
16:36:56 test_subclass (tests.test_with.WithCursorTestCase) ... ok
16:36:56 test_with_error (tests.test_with.WithCursorTestCase) ... ok
16:36:56 test_with_ok (tests.test_with.WithCursorTestCase) ... ok
16:36:56 
16:36:56 ======================================================================
16:36:56 FAIL: test_ssl_attribute (tests.test_connection.TestConnectionInfo)
16:36:56 ----------------------------------------------------------------------
16:36:56 Traceback (most recent call last):
16:36:56   File "/tmp/autopkgtest.PyQGhl/build.UJR/src/tests/test_connection.py", line 1936, in test_ssl_attribute
16:36:56     self.assertIsNone(self.bconn.info.ssl_attribute(attrib))
16:36:56 AssertionError: 'OpenSSL' is not None
16:36:56 
16:36:56 ----------------------------------------------------------------------
16:36:56 Ran 738 tests in 19.971s
16:36:56 
16:36:56 FAILED (failures=1, skipped=94)

Full log: https://pgdgbuild.dus.dg-i.net/job/psycopg2-autopkgtest-beta/architecture=amd64,distribution=sid/1/console

A new release with a fix would be appreciated so we can update the package without triggering regressions when PG15 is uploaded.

@dvarrazzo
Copy link
Member

I assume this is related to pg bug #17625, right?

The new "release" I understand wouldn't change the code, it's just the test suite that should test that code differently with PG15. We usually don't make release which don't involve changes in the code. Would applying a patch to the test suite be ok for you?

I will set up a branch to test the adapter with PG15 and make the appropriate changes to make the tests pass.

@df7cb
Copy link
Contributor Author

df7cb commented Oct 5, 2022

Hi,
by the definition of "does it pass the regression tests", the package is broken with PG15. I don't particularly care if it needs code or test changes to fix that. If you don't want to teach people that ignoring the regression tests on psycopg2 is ok since they aren't important, I'd recommend just releasing a new minor version with the fix.
Thanks.

@dvarrazzo
Copy link
Member

I am adding pg15 to the test suite and I'll see what to do there. Thank you for the report.

@df7cb
Copy link
Contributor Author

df7cb commented Oct 5, 2022

Sorry for the rant earlier this evening. I have too many packages where changes are just sitting on the master branch without any releases happening.

@dvarrazzo
Copy link
Member

A new release is on the way.

@df7cb
Copy link
Contributor Author

df7cb commented Oct 6, 2022

Thanks, all the CI tests here are happy now!

@dvarrazzo
Copy link
Member

I haven't released the packages on pypi yet because I'm waiting for the windows ones to build on appveyor 🐌

I assume you are downloading the source using the new tag? That's alright of course, that's were we build from too.

@df7cb
Copy link
Contributor Author

df7cb commented Oct 6, 2022

I used the git tag now, yes.

@df7cb
Copy link
Contributor Author

df7cb commented May 29, 2023

This seems to be back with PG 16 beta1:

FAIL: test_ssl_attribute (tests.test_connection.TestConnectionInfo.test_ssl_attribute)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/autopkgtest-lxc.wsqc7ozb/downtmp/build.fze/src/tests/test_connection.py", line 1925, in test_ssl_attribute
    self.assert_(attribs)
AssertionError: [] is not true

Full log: https://ci.debian.net/data/autopkgtest/unstable/amd64/p/psycopg2/33839641/log.gz

This is with psycopg2 2.9.5, but I don't see anything relevant in the git log, so I assume it applies to head as well.

@dvarrazzo
Copy link
Member

@df7cb could you please provide a MR to disable that check for postgres > 15?

df7cb added a commit to df7cb/psycopg2 that referenced this issue May 29, 2023
PG15 changed the semantics of some ssl attributes (psycopg#1506), and a very
similar regression test failure has now been observed again with PG16.
Disable the test for now.
dvarrazzo pushed a commit that referenced this issue May 29, 2023
PG15 changed the semantics of some ssl attributes (#1506), and a very
similar regression test failure has now been observed again with PG16.
Disable the test for now.
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

No branches or pull requests

2 participants