Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

test(rust): prevent export test stack overflow

zipg533c7a963343
diff --git a/crates/dbx-core/tests/database_export_prefetch.rs b/crates/dbx-core/tests/database_export_prefetch.rs
index 099eb1ba5d..c02bbf3fa9 100644
--- a/crates/dbx-core/tests/database_export_prefetch.rs
+++ b/crates/dbx-core/tests/database_export_prefetch.rs
@@ -143,8 +143,25 @@ fn postgres_test_config(id: &str, port: u16) -> ConnectionConfig {
}
}
-#[tokio::test]
-async fn database_export_writes_structure_and_data_for_all_tables() {
+#[test]
+fn database_export_writes_structure_and_data_for_all_tables() {
+ let handle = std::thread::Builder::new()
+ .name("database-export-prefetch".to_string())
+ .stack_size(8 * 1024 * 1024)
+ .spawn(|| {
+ tokio::runtime::Builder::new_current_thread()
+ .enable_all()
+ .build()
+ .expect("build database export prefetch test runtime")
+ .block_on(run_database_export_writes_structure_and_data_for_all_tables());
+ })
+ .expect("spawn database export prefetch test thread");
+ if let Err(panic) = handle.join() {
+ std::panic::resume_unwind(panic);
+ }
+}
+
+async fn run_database_export_writes_structure_and_data_for_all_tables() {
let Some(container) = start_docker_postgres() else {
return;
};