From 0e9457cee0b45689191159acd4e72a06ef377f3d Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Fri, 21 Mar 2025 09:16:46 -0700 Subject: [PATCH] Try to use mariadb in unittest again The last time we tried this we had to revert due to flaky testing that resulted. Now that we're aware mariadb vs mysql dialects may be impactful we try again explicitly using the mariadb dialect in testing. We switch zuul-nox and children over to debian-bookworm instead of ubuntu-jammy so that we get python 3.11 and mariadb 10.11 on the host. ubuntu-jammy has mariadb 10.6 which may be the source of the per test db schema problems. I think before we land this we will want to do much rechecking in order to determine if any flaky tests are due to database instability. Previously the db issues seemed to be around test isolation iirc. Change-Id: I2f85a07cae2e7ba6566806ec70dbc3ac36a77f10 --- .zuul.yaml | 4 ++-- bindep.txt | 4 ++-- tests/base.py | 2 +- tools/docker-compose.yaml | 5 +++-- tools/test-setup-docker.sh | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index 058dd112f8..01160aed16 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -59,7 +59,7 @@ description: | Zuul unit tests with ZooKeeper running parent: nox - nodeset: ubuntu-jammy + nodeset: debian-bookworm pre-run: playbooks/zuul-nox/pre.yaml post-run: playbooks/zuul-nox/post-system-logs.yaml vars: @@ -79,7 +79,7 @@ - job: name: zuul-nox-remote parent: nox - nodeset: ubuntu-jammy + nodeset: debian-bookworm timeout: 2700 # 45 minutes pre-run: playbooks/zuul-nox/pre.yaml post-run: playbooks/zuul-nox/post-system-logs.yaml diff --git a/bindep.txt b/bindep.txt index 083c6a1805..e6117d8a07 100644 --- a/bindep.txt +++ b/bindep.txt @@ -1,9 +1,9 @@ # This is a cross-platform list tracking distribution packages needed by tests; # see http://docs.openstack.org/infra/bindep/ for additional information. -mysql-client [test !platform:rpm] +mariadb-client [test !platform:rpm] +mariadb-server [test] mysql [test platform:rpm] -mysql-server [test] postgresql [test] openssl [test] musl-dev [compile test platform:apk] diff --git a/tests/base.py b/tests/base.py index 6e8874495e..8726d009c7 100644 --- a/tests/base.py +++ b/tests/base.py @@ -1723,7 +1723,7 @@ class MySQLSchemaFixture(fixtures.Fixture): if connected: db.close() - self.dburi = 'mysql+pymysql://{name}:{passwd}@{host}:{port}/{name}'\ + self.dburi = 'mariadb+pymysql://{name}:{passwd}@{host}:{port}/{name}'\ .format( name=self.name, passwd=self.passwd, diff --git a/tools/docker-compose.yaml b/tools/docker-compose.yaml index 05b4905e2e..71f75f051d 100644 --- a/tools/docker-compose.yaml +++ b/tools/docker-compose.yaml @@ -2,8 +2,9 @@ version: "3" services: mysql: - container_name: zuul-test-mysql - image: mysql:8.0 + container_name: zuul-test-mariadb + # Roughly matches version in Ubuntu Noble + image: mariadb:10.11 environment: - MYSQL_ROOT_PASSWORD=insecure_worker ports: diff --git a/tools/test-setup-docker.sh b/tools/test-setup-docker.sh index b3cef01b45..f457b1d266 100755 --- a/tools/test-setup-docker.sh +++ b/tools/test-setup-docker.sh @@ -40,7 +40,7 @@ else fi -MYSQL="${DOCKER} exec zuul-test-mysql mysql -u root -pinsecure_worker" +MYSQL="${DOCKER} exec zuul-test-mariadb mysql -u root -pinsecure_worker" if [ "${COMPOSE}" == "docker-compose" ]; then ${ROOTCMD} docker-compose rm -sf