feat: MariaDB mysql-test suite infrastructure#253
Merged
Conversation
Build mysqltest (mariadb-test) for wasm32 and create a test harness that runs upstream MariaDB 10.5 mysql-test suite tests against the wasm-posix-kernel platform. Key components: - Extended build-mariadb.sh to compile mysqltest binary (3.8MB wasm) and copy mysql-test data (1184 test files) - Patch 004: redirect mysql_server_init to client-only stubs so mysqltest links against libmariadbclient instead of embedded server - TypeScript harness (run-tests.ts) manages full lifecycle: bootstrap, server start, per-test mysqltest execution, server restart on timeout - Shell wrapper (run-mariadb-tests.sh) with curated passing test list (89 tests) and comprehensive XFAIL categorization Infrastructure fixes discovered during triage: - Root TCP grants: FLUSH PRIVILEGES re-enables grant checking; setup SQL now inserts root@127.0.0.1 and root@% with full passwordless access - Stored procedure definer: CREATE DEFINER='root'@'localhost' prevents "definer does not exist" errors after FLUSH PRIVILEGES - Aria crash recovery: server restart cleans aria_log_control to avoid checksum mismatch after ungraceful shutdown - MYSQLTEST_VARDIR set to test-data dir for file path validation - --protocol=tcp forces TCP connections (avoids unix socket attempts) Failure categories identified (XFAIL): - Multi-connection: 'connect' command deadlocks with no-threads (~111) - InnoDB: storage engine not available (~228) - exec/system: shell commands not supported (~109) - Debug: requires debug build (~78) - Timeout: tests too slow for 60s on wasm (~27) - Grants, SSL, binlog, plugins: various unsupported features
2 tasks
brandonpayton
added a commit
that referenced
this pull request
Apr 11, 2026
## Summary - Add `mariadb` test suite to `run.sh` dispatcher — run via `./run.sh test mariadb` - Register `mysqltest.wasm` in `builtinPrograms` map in `run-example.ts` for exec resolution Follow-up to #253 (MariaDB mysql-test suite infrastructure). ## Test plan - [ ] `./run.sh test mariadb` runs the curated 89-test suite - [ ] No impact on existing test suites 🤖 Generated with [Claude Code](https://claude.com/claude-code)
brandonpayton
added a commit
that referenced
this pull request
May 29, 2026
## Summary - Build `mysqltest` (mariadb-test) binary for wasm32 — extends the existing MariaDB cross-compilation pipeline to produce a 3.8MB mysqltest.wasm plus all 1,184 upstream mysql-test suite test files - TypeScript test harness (`examples/mariadb-test/run-tests.ts`) manages the full lifecycle: bootstrap system tables, start mariadbd in server mode, run individual mysqltest processes per-test, handle timeouts with automatic server restart - Shell wrapper (`scripts/run-mariadb-tests.sh`) with a curated set of **89 passing tests** and comprehensive XFAIL categorization covering ~600 known-failing tests ### Infrastructure fixes discovered during triage - **Root TCP grants**: `FLUSH PRIVILEGES` re-enables grant checking; setup SQL inserts `root@127.0.0.1` and `root@%` with full passwordless access - **Stored procedure definer**: `CREATE DEFINER='root'@'localhost'` prevents "definer does not exist" errors after `FLUSH PRIVILEGES` - **Aria crash recovery**: server restart cleans `aria_log_control` to avoid checksum mismatch - **`--protocol=tcp`**: forces TCP connections to avoid unix socket attempts ### Failure categories (XFAIL) | Category | Count | Reason | |----------|-------|--------| | Multi-connection | ~111 | `connect` command deadlocks with `--thread-handling=no-threads` | | InnoDB | ~228 | Storage engine not available (Aria only) | | exec/system | ~109 | Shell commands not supported in wasm | | Debug | ~78 | Requires debug build (`debug_dbug`, `debug_sync`) | | Timeout | ~27 | Tests too slow for 60s on wasm | | Grants/SSL/binlog/plugins | ~50+ | Various unsupported features | ## Test plan - [ ] `scripts/run-mariadb-tests.sh` runs 89 curated tests with 0 unexpected failures - [ ] `scripts/run-mariadb-tests.sh --all` runs all 1,184 tests (slow; failures are XFAIL) - [ ] Existing test suites unaffected (cargo, vitest, libc-test, POSIX, sortix) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
brandonpayton
added a commit
that referenced
this pull request
May 29, 2026
## Summary - Add `mariadb` test suite to `run.sh` dispatcher — run via `./run.sh test mariadb` - Register `mysqltest.wasm` in `builtinPrograms` map in `run-example.ts` for exec resolution Follow-up to #253 (MariaDB mysql-test suite infrastructure). ## Test plan - [ ] `./run.sh test mariadb` runs the curated 89-test suite - [ ] No impact on existing test suites 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mysqltest(mariadb-test) binary for wasm32 — extends the existing MariaDB cross-compilation pipeline to produce a 3.8MB mysqltest.wasm plus all 1,184 upstream mysql-test suite test filesexamples/mariadb-test/run-tests.ts) manages the full lifecycle: bootstrap system tables, start mariadbd in server mode, run individual mysqltest processes per-test, handle timeouts with automatic server restartscripts/run-mariadb-tests.sh) with a curated set of 89 passing tests and comprehensive XFAIL categorization covering ~600 known-failing testsInfrastructure fixes discovered during triage
FLUSH PRIVILEGESre-enables grant checking; setup SQL insertsroot@127.0.0.1androot@%with full passwordless accessCREATE DEFINER='root'@'localhost'prevents "definer does not exist" errors afterFLUSH PRIVILEGESaria_log_controlto avoid checksum mismatch--protocol=tcp: forces TCP connections to avoid unix socket attemptsFailure categories (XFAIL)
connectcommand deadlocks with--thread-handling=no-threadsdebug_dbug,debug_sync)Test plan
scripts/run-mariadb-tests.shruns 89 curated tests with 0 unexpected failuresscripts/run-mariadb-tests.sh --allruns all 1,184 tests (slow; failures are XFAIL)🤖 Generated with Claude Code