test(settings): align assertions with 60s query timeout

This commit is contained in:
t8y2
2026-09-08 20:55:21 +08:00
parent 1431d4996f
commit 52f23e3c79
4 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -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);
+1 -1
View File
@@ -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,
});
});
+2 -2
View File
@@ -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();
+1 -1
View File
@@ -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);