Skip to content

feat: MariaDB mysql-test suite infrastructure#253

Merged
brandonpayton merged 1 commit into
mainfrom
mariadb-test
Apr 11, 2026
Merged

feat: MariaDB mysql-test suite infrastructure#253
brandonpayton merged 1 commit into
mainfrom
mariadb-test

Conversation

@brandonpayton
Copy link
Copy Markdown
Member

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

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
@brandonpayton brandonpayton merged commit 9ed7339 into main Apr 11, 2026
@brandonpayton brandonpayton deleted the mariadb-test branch April 11, 2026 02:33
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)
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.

1 participant