mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-08-30 06:47:42 +00:00
⏲️ test: Give ServerConfigsDB Mongo Hooks a 60s Timeout Budget (#14831)
`beforeAll` boots a real mongod via MongoMemoryServer, resets the module registry and re-imports data-schemas, ServerConfigsDB and the MCP OAuth handler before a single test runs. That exceeds the 15s global `testTimeout` once the runner is busy: the suite finishes in ~4.5s on its own but has been observed at 16.8s under a loaded `@librechat/api` shard, failing every test in the file with "Exceeded timeout of 15000 ms for a hook". Give both mongo hooks an explicit 60s budget, matching `checkpointer.integration.spec.ts`, the other MongoMemoryServer suite that already opts out of the global default. `afterAll` gets the same treatment since `mongoServer.stop()` is subject to the same contention. No behaviour change — the timeout only bounds setup, and the suite still completes well inside it.
This commit is contained in:
parent
eaef87fa26
commit
0ce4c3374b
1 changed files with 5 additions and 2 deletions
|
|
@ -77,12 +77,15 @@ beforeAll(async () => {
|
|||
await dbMethods.seedDefaultRoles();
|
||||
|
||||
serverConfigsDB = new ServerConfigsDB(mongoose);
|
||||
});
|
||||
/** Booting a real mongod, resetting the module registry and re-importing
|
||||
* data-schemas costs more than the 15s global `testTimeout`, once the runner
|
||||
* is busy enough. Matches `checkpointer.integration.spec.ts`. */
|
||||
}, 60000);
|
||||
|
||||
afterAll(async () => {
|
||||
await mongoose.disconnect();
|
||||
await mongoServer.stop();
|
||||
});
|
||||
}, 60000);
|
||||
|
||||
beforeEach(async () => {
|
||||
// Clear collections except AccessRole
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue