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。

perf(test): raise local vitest workers to 8 with 10s timeout

t8y26bdfd7280923
diff --git a/package.json b/package.json
index 9f253442f2..29c7f24cfd 100644
--- a/package.json
+++ b/package.json
@@ -40,6 +40,7 @@
"fmt": "oxfmt \"apps/desktop/src/**/*.{ts,vue}\"",
"pretest": "pnpm generate:connection-types",
"test": "vitest run",
+ "test:watch": "vitest",
"preview": "vite preview --config apps/desktop/vite.config.ts",
"tauri": "tauri",
"prepare": "husky"
diff --git a/vitest.config.ts b/vitest.config.ts
index 27aba5d20f..91bbb1089f 100644
--- a/vitest.config.ts
+++ b/vitest.config.ts
@@ -13,9 +13,14 @@ export default defineConfig({
test: {
include: ["packages/app-tests/*.test.ts", "apps/desktop/src/**/*.spec.ts", "docs/lib/*.test.ts"],
globalSetup: "packages/test-globals.ts",
- // Large store modules are dynamically imported in many specs. Limiting
- // concurrency prevents those imports from starving timers and making
- // otherwise deterministic deferred-promise tests exceed Vitest's timeout.
- maxWorkers: 4,
+ // Many specs dynamically import the large store modules (connectionStore,
+ // queryStore) inside test bodies; when several workers pay that first
+ // import at once, CPU contention can stall a worker's event loop past the
+ // old 5s default and flake deferred-promise tests. A 10s timeout absorbs
+ // that without capping throughput, so workers can scale past 4. CI keeps
+ // 4 workers: its 4-vCPU runners already run vue-tsc/oxlint/oxfmt
+ // concurrently with vitest via `pnpm check`.
+ testTimeout: 10_000,
+ maxWorkers: process.env.CI ? 4 : 8,
},
});