feat(targets): add check_mysql_server_available probe function (#2884)

Signed-off-by: JaySon-Huang <tshent@qq.com>
Co-authored-by: houseme <housemecn@gmail.com>
This commit is contained in:
JaySon
2026-05-10 19:53:45 +08:00
committed by GitHub
parent 53ec1b95d8
commit bafff6d207
12 changed files with 131 additions and 58 deletions
+24
View File
@@ -266,3 +266,27 @@ async fn incompatible_schema_init_fails() {
drop_table(&dsn, &table).await;
}
#[ignore]
#[tokio::test]
async fn check_mysql_server_available_succeeds_against_existing_table() {
let dsn = test_dsn();
let table = table_name("test_check");
{
let pool = build_test_pool(&dsn);
let mut conn = pool.get_conn().await.expect("get conn");
conn.query_drop(format!(
"CREATE TABLE `{table}` (event_time DATETIME(6) NOT NULL, event_data JSON NOT NULL)"
))
.await
.expect("create table");
}
let args = make_args(&dsn, &table, "");
rustfs_targets::check_mysql_server_available(&args)
.await
.expect("connectivity probe should succeed against existing table");
drop_table(&dsn, &table).await;
}