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
This commit is contained in:
Clark Boylan
2025-03-21 09:16:46 -07:00
parent 3a453bfeed
commit 0e9457cee0
5 changed files with 9 additions and 8 deletions

View File

@@ -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

View File

@@ -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]

View File

@@ -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,

View File

@@ -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:

View File

@@ -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