Tests fails on PostgreSQL 14

Bug #1989208 reported by Stephen Finucane
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.db
Fix Released
Undecided
Unassigned

Bug Description

From a recent gate test:

==============================
Failed 1 tests - output below:
==============================

oslo_db.tests.sqlalchemy.test_exc_filters.TestNonExistentDatabasePostgreSQL.test_raise
--------------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):

      File "/home/zuul/src/opendev.org/openstack/oslo.db/oslo_db/tests/sqlalchemy/test_exc_filters.py", line 465, in test_raise
    self.assertInnerException(

      File "/home/zuul/src/opendev.org/openstack/oslo.db/oslo_db/tests/sqlalchemy/test_exc_filters.py", line 45, in assertInnerException
    self.assertSQLAException(exc, exception_type, message, sql, params)

      File "/home/zuul/src/opendev.org/openstack/oslo.db/oslo_db/tests/sqlalchemy/test_exc_filters.py", line 60, in assertSQLAException
    self.assertEqual(message.lower(), str(exc.orig).lower())

      File "/home/zuul/src/opendev.org/openstack/oslo.db/.tox/py310/lib/python3.10/site-packages/testtools/testcase.py", line 393, in assertEqual
    self.assertThat(observed, matcher, message)

      File "/home/zuul/src/opendev.org/openstack/oslo.db/.tox/py310/lib/python3.10/site-packages/testtools/testcase.py", line 480, in assertThat

    raise mismatch_error

    testtools.matchers._impl.MismatchError: !=:
reference = '''\
fatal: database "non_existent_database" does not exist
'''
actual = '''\
connection to server at "localhost" (::1), port 5432 failed: fatal: database "non_existent_database" does not exist
'''

Changed in oslo.db:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.db (master)

Reviewed: https://review.opendev.org/c/openstack/oslo.db/+/856836
Committed: https://opendev.org/openstack/oslo.db/commit/437a19703d63801997f2ccece516a2790d438cee
Submitter: "Zuul (22348)"
Branch: master

commit 437a19703d63801997f2ccece516a2790d438cee
Author: Stephen Finucane <email address hidden>
Date: Fri Sep 9 17:34:40 2022 +0100

    tests: Fix compatibility with PostgreSQL 14+

    It seems postgres-client has changed the format of error messages.
    Previously we saw messages like:

      fatal: database "non_existent_database" does not exist

    These are now prefixed. For example:

      connection to server at "localhost" (::1), port 5432 failed: fatal:
      database "non_existent_database" does not exist

    You can see this in the docs. Compare the "Client Connection Problems"
    section for Postgres 13 [1] to Postgres 14 [2].

    [1] https://www.postgresql.org/docs/13/server-start.html
    [2] https://www.postgresql.org/docs/14/server-start.html

    Change-Id: Id2c8eec202d128d142b8a8a8f904fcc14b6f52d7
    Signed-off-by: Stephen Finucane <email address hidden>
    Closes-bug: #1989208

Changed in oslo.db:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/oslo.db 12.2.0

This issue was fixed in the openstack/oslo.db 12.2.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.