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(settings): align assertions with 60s query timeout

t8y252f23e3c795a
diff --git a/packages/app-tests/connectionStoreErrorState.test.ts b/packages/app-tests/connectionStoreErrorState.test.ts
index cda78b1309..0b6a72b63b 100644
--- a/packages/app-tests/connectionStoreErrorState.test.ts
+++ b/packages/app-tests/connectionStoreErrorState.test.ts
@@ -357,9 +357,9 @@ test("hanging database metadata load times out and clears loading state", async
});
const loadPromise = store.loadDatabases("conn-1");
- const timeoutRejection = assert.rejects(() => loadPromise, /Connection timed out while loading databases after 35s/);
+ const timeoutRejection = assert.rejects(() => loadPromise, /Connection timed out while loading databases after 65s/);
- await vi.advanceTimersByTimeAsync(35000);
+ await vi.advanceTimersByTimeAsync(65000);
await timeoutRejection;
assert.equal(store.treeNodes[0].isLoading, false);
@@ -590,9 +590,9 @@ test.each([
});
const loadPromise = store[loader]("conn-1");
- const timeoutRejection = assert.rejects(() => loadPromise, new RegExp(`Connection timed out while loading ${label} after 35s`));
+ const timeoutRejection = assert.rejects(() => loadPromise, new RegExp(`Connection timed out while loading ${label} after 65s`));
- await vi.advanceTimersByTimeAsync(35000);
+ await vi.advanceTimersByTimeAsync(65000);
await timeoutRejection;
assert.equal(store.treeNodes[0].isLoading, false);
diff --git a/packages/app-tests/dataGridQueryOptions.test.ts b/packages/app-tests/dataGridQueryOptions.test.ts
index 68fbcd2cc0..1922c40135 100644
--- a/packages/app-tests/dataGridQueryOptions.test.ts
+++ b/packages/app-tests/dataGridQueryOptions.test.ts
@@ -19,6 +19,6 @@ test("count queries preserve disabled timeouts", () => {
test("count queries use the frontend default for missing configurations", () => {
assert.deepEqual(dataGridCountQueryOptions(undefined), {
maxRows: 1,
- timeoutSecs: 30,
+ timeoutSecs: 60,
});
});
diff --git a/packages/app-tests/queryStore.test.ts b/packages/app-tests/queryStore.test.ts
index ff40b6ba88..b5b50fbd32 100644
--- a/packages/app-tests/queryStore.test.ts
+++ b/packages/app-tests/queryStore.test.ts
@@ -7510,7 +7510,7 @@ test("query execution is scoped to the tab client session", async () => {
await store.executeTabSql(tabId, "select 1");
assert.equal(executeBody.clientSessionId, tabId);
- assert.equal(executeBody.timeoutSecs, 30);
+ assert.equal(executeBody.timeoutSecs, 60);
} finally {
globalThis.fetch = originalFetch;
restoreStorage();
@@ -7729,7 +7729,7 @@ test("data tab execution uses a tab-scoped client session", async () => {
await store.executeTabSql(tabId, "select * from users");
assert.equal(executeBody.clientSessionId, tabId);
- assert.equal(executeBody.timeoutSecs, 30);
+ assert.equal(executeBody.timeoutSecs, 60);
} finally {
globalThis.fetch = originalFetch;
restoreStorage();
diff --git a/packages/app-tests/queryTimeout.test.ts b/packages/app-tests/queryTimeout.test.ts
index 3ffbc10ec3..1c893e65a5 100644
--- a/packages/app-tests/queryTimeout.test.ts
+++ b/packages/app-tests/queryTimeout.test.ts
@@ -6,7 +6,7 @@ import { DEFAULT_QUERY_TIMEOUT_SECS, frontendQueryTimeoutSecsForSql, queryTimeou
const contentAreaSource = readFileSync("apps/desktop/src/components/layout/ContentArea.vue", "utf8");
test("queryTimeoutSecsForConnection falls back to the default timeout", () => {
- assert.equal(DEFAULT_QUERY_TIMEOUT_SECS, 30);
+ assert.equal(DEFAULT_QUERY_TIMEOUT_SECS, 60);
assert.equal(queryTimeoutSecsForConnection(undefined), DEFAULT_QUERY_TIMEOUT_SECS);
assert.equal(queryTimeoutSecsForConnection({ query_timeout_secs: -1 }), DEFAULT_QUERY_TIMEOUT_SECS);
assert.equal(queryTimeoutSecsForConnection({ query_timeout_secs: 0 }), 0);