Skip to content

Python unit tests failing - latest sql image uses newer version that is not caught in regex #3731

@crispin-ki

Description

@crispin-ki

Expected Behavior

Python unit tests pass (in test_sql_registry.py)

Current Behavior

Tests currently fail (both locally and in cicd such as here), as the mysql:latest image defined here now uses mysql Version 8.1.0, not 8.0.* as expected here

Steps to reproduce

Run one of the failing tests, such as pytest sdk/python/tests/unit/test_sql_registry.py::test_registry_cache[mysql_registry] -vvs locally

Possible Solution

A solution is to simply change this line from log_string_to_wait_for = "/usr/sbin/mysqld: ready for connections. Version: '8.0.*' socket: '/var/run/mysqld/mysqld.sock' port: 3306" to log_string_to_wait_for = "/usr/sbin/mysqld: ready for connections. Version: '(\d+(\.\d+){1,2})' socket: '/var/run/mysqld/mysqld.sock' port: 3306". I have tested this change locally, and tests then pass.

Changing the version to regex is more flexible, as if we change it just to '8.1.*' then we will run into this issues again. The regex will match any number of digits with either 1 or two dots separating them. This is what we want for version numbers.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions