mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-08-04 14:57:42 +00:00
* perf: reduce agent chat startup latency * test: align Redis stream readiness assertions * perf: overlap remaining agent startup work * perf: persist initial agent job metadata atomically * test: add agent startup latency benchmark * fix: harden resumable agent stream lifecycle * fix: isolate replacement stream lifecycles * fix: preserve terminal stream epochs
29 lines
1 KiB
TypeScript
29 lines
1 KiB
TypeScript
import { defineConfig } from '@playwright/test';
|
|
import path from 'node:path';
|
|
import mockConfig from './playwright.config.mock';
|
|
|
|
process.env.MOCK_LLM_REPLY ??= 'BENCH_TOKEN';
|
|
process.env.MOCK_LLM_CHUNK_DELAY_MS ??= '1';
|
|
|
|
const mongoDelay = Number.parseInt(process.env.E2E_LATENCY_MONGO_DELAY_MS ?? '', 10);
|
|
if (Number.isInteger(mongoDelay) && mongoDelay > 0) {
|
|
const latencyHook = path.resolve(__dirname, 'benchmarks/mongoose-latency-hook.cjs');
|
|
if (!process.env.NODE_OPTIONS?.includes(latencyHook)) {
|
|
process.env.NODE_OPTIONS = [process.env.NODE_OPTIONS, `--require=${latencyHook}`]
|
|
.filter(Boolean)
|
|
.join(' ');
|
|
}
|
|
}
|
|
|
|
export default defineConfig({
|
|
...mockConfig,
|
|
testDir: 'benchmarks',
|
|
outputDir: 'benchmarks/.test-results',
|
|
timeout: 20 * 60 * 1000,
|
|
retries: 0,
|
|
reporter: [['line']],
|
|
/** The benchmark uses the stdio MCP fixture loaded by LibreChat, not the HTTP fixture. */
|
|
webServer: Array.isArray(mockConfig.webServer)
|
|
? mockConfig.webServer.slice(0, 1)
|
|
: mockConfig.webServer,
|
|
});
|