mirror of https://github.com/sysown/proxysql
Pre-existing test bug surfaced by CI-unit-tests-asan-coverage on
plugin-chassis (run 25202654334, head bb199c6c). 4 of 6 assertions
failed:
not ok 3 - mysqlx_users registered in admin_db
not ok 4 - mysqlx_users registered in config_db
not ok 5 - mysqlx_users admin schema includes allowed_auth_methods
not ok 6 - mysqlx_users config schema includes backend_auth_mode
Root cause: the mysqlx plugin (ABI 2+) registers its admin tables in
register_schemas() — Phase B of the four-phase lifecycle — not in
init() / Phase D. The test only does load() + init_all(), skipping
Phase B entirely, so mgr.tables(admin_db) and mgr.tables(config_db)
return empty vectors and find_table() returns nullptr for every
table-existence assertion.
The test was written before the four-phase lifecycle was finalised;
when mysqlx_register_admin_schema moved into Phase B (the Phase B
mysqlx_register_schemas wraps it; init_all() no longer touches the
admin-table-registration path), this test was not updated.
# Fix
Insert mgr.invoke_register_schemas_phase(err) between load() and
init_all(). For ABI-1 plugins that don't declare register_schemas
the call is a no-op (returns true with err empty). The plan goes
from 6 to 7 to cover the new assertion.
Verified locally:
$ ./test_mysqlx_plugin_load-t
1..7
ok 1 - load mysqlx plugin succeeds
ok 2 - invoke_register_schemas_phase registers mysqlx schema
ok 3 - init_all completes after schema registration
ok 4 - mysqlx_users registered in admin_db
ok 5 - mysqlx_users registered in config_db
ok 6 - mysqlx_users admin schema includes allowed_auth_methods
ok 7 - mysqlx_users config schema includes backend_auth_mode
# Why now
This wasn't caught earlier because the same plugin-load assertions
were partially covered by sibling tests (test_mysqlx_admin_tables-t,
plugin_manager_unit-t) that drove the full Phase A→B→D lifecycle.
test_mysqlx_plugin_load-t was the only test with the load+init-only
shortcut. CI-unit-tests-asan-coverage on plugin-chassis is the
specific job that runs every *-t binary in test/tap/tests/unit (the
file lives in test/tap/tests/, not unit/, but groups.json registers
it with @proxysql_min_version:4.0 so the chassis gates are right).
fix/test-mysqlx-plugin-load-phase-b
parent
f1587cf5c2
commit
eebfbde2b3
Loading…
Reference in new issue