Skip to content

testutils: log database name and truncate to 64-char MySQL limit#741

Merged
morgo merged 2 commits into
block:mainfrom
morgo:testutils-cleanup-logging
May 1, 2026
Merged

testutils: log database name and truncate to 64-char MySQL limit#741
morgo merged 2 commits into
block:mainfrom
morgo:testutils-cleanup-logging

Conversation

@morgo
Copy link
Copy Markdown
Collaborator

@morgo morgo commented Apr 30, 2026

Changes to CreateUniqueTestDatabase:

  1. Log the database name via t.Log() so it's visible in test output when debugging failures
  2. Truncate to 64 characters — MySQL's identifier name limit. Long test names (e.g., deeply nested subtests) could produce database names exceeding this limit, causing silent CREATE DATABASE failures.

CreateUniqueTestDatabase now:
- Logs the database name via t.Log() for easier debugging when tests fail
- Truncates the database name to 64 characters (MySQL's identifier limit)
  to prevent CREATE DATABASE failures with long test names

Fixes block#738
@morgo morgo force-pushed the testutils-cleanup-logging branch from aa593c6 to b5d93c0 Compare April 30, 2026 23:41
@morgo morgo merged commit 11734f4 into block:main May 1, 2026
12 checks passed
@morgo morgo deleted the testutils-cleanup-logging branch May 1, 2026 00:13
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

Successfully merging this pull request may close these issues.

2 participants