⚙️ fix: Guard Mongo Cleanup In Package Service Tests (#17992)

* fix: Guard Mongo Cleanup In Package Services Tests
* fix: Guard Mongo Cleanup In Agents Precedence And Promotion Tests
This commit is contained in:
Marco Beretta 2026-11-13 18:18:17 +01:00 • committed by GitHub
parent 368e376cee
commit fbca86bba9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 28 additions and 28 deletions

View file

@ -227,7 +227,7 @@ beforeAll(async () => {
afterAll(async () => {
await mongoose.disconnect();
await mongoServer.stop();
await mongoServer?.stop();
}, LIFECYCLE_TIMEOUT_MS);
describe('hiding librechat.yaml custom endpoints by key', () => {

View file

@ -286,7 +286,7 @@ afterEach(async () => {
afterAll(async () => {
await mongoose.disconnect();
await mongod.stop();
await mongod?.stop();
}, DB_SETUP_TIMEOUT_MS);
describe('completion wake-ups and queued user turns at run end', () => {

View file

@ -52,7 +52,7 @@ beforeAll(async () => {
afterAll(async () => {
await mongoose.disconnect();
await mongo.stop();
await mongo?.stop();
});
beforeEach(async () => {

View file

@ -92,7 +92,7 @@ beforeAll(async () => {
afterAll(async () => {
await mongoose.disconnect();
await mongoServer.stop();
await mongoServer?.stop();
});
beforeEach(async () => {

View file

@ -21,7 +21,7 @@ afterEach(async () => {
});
afterAll(async () => {
await mongoServer.stop();
await mongoServer?.stop();
});
describe('KeyvMongo key index', () => {

View file

@ -30,7 +30,7 @@ describe('code environment registry', () => {
afterAll(async () => {
await mongoose.disconnect();
await mongoServer.stop();
await mongoServer?.stop();
});
beforeEach(async () => {

View file

@ -117,7 +117,7 @@ describe('resolveSubagentCodeWorkspaceInheritance', () => {
afterAll(async () => {
await mongoose.disconnect();
await mongoServer.stop();
await mongoServer?.stop();
});
beforeEach(async () => {

View file

@ -42,7 +42,7 @@ describe('staged browser setup registry', () => {
});
afterAll(async () => {
await mongoose.disconnect();
await mongo.stop();
await mongo?.stop();
});
test('explicitly enforces owner-slot uniqueness when automatic index creation is disabled', async () => {

View file

@ -193,7 +193,7 @@ describe('browser setup HTTP protocol boundary', () => {
else process.env[name] = value;
}
await mongoose.disconnect();
await mongo.stop();
await mongo?.stop();
});
function app(options: { registrationUnavailable?: boolean } = {}) {

View file

@ -274,7 +274,7 @@ describe('browser setup durable lifecycle', () => {
});
afterAll(async () => {
await mongoose.disconnect();
await mongo.stop();
await mongo?.stop();
});
test('resumes immutable starts, returns the CLI approval, and idempotently completes the final owner slot', async () => {

View file

@ -92,7 +92,7 @@ describe('subagent code targets against the principal-scoped machine list', () =
afterAll(async () => {
await mongoose.disconnect();
await mongoServer.stop();
await mongoServer?.stop();
});
beforeEach(async () => {

View file

@ -60,7 +60,7 @@ beforeAll(async () => {
afterAll(async () => {
await mongoose.disconnect();
await mongoServer.stop();
await mongoServer?.stop();
});
beforeEach(async () => {

View file

@ -58,7 +58,7 @@ describe('getPluginAuthMap with mixed-version records', () => {
afterAll(async () => {
await mongoose.disconnect();
await mongoServer.stop();
await mongoServer?.stop();
});
it('decrypts legacy and v3 records stored for the same plugin', async () => {

View file

@ -21,7 +21,7 @@ beforeAll(async () => {
afterAll(async () => {
await mongoose.disconnect();
await mongo.stop();
await mongo?.stop();
});
beforeEach(async () => {

View file

@ -28,7 +28,7 @@ beforeAll(async () => {
afterAll(async () => {
await mongoose.disconnect();
await mongo.stop();
await mongo?.stop();
});
beforeEach(async () => {

View file

@ -156,7 +156,7 @@ beforeAll(async () => {
afterAll(async () => {
await mongoose.disconnect();
await mongod.stop();
await mongod?.stop();
});
beforeEach(async () => {

View file

@ -37,7 +37,7 @@ beforeAll(async () => {
afterAll(async () => {
await mongoose.disconnect();
await mongoServer.stop();
await mongoServer?.stop();
});
beforeEach(async () => {

View file

@ -52,7 +52,7 @@ beforeAll(async () => {
afterAll(async () => {
await mongoose.disconnect();
await mongoServer.stop();
await mongoServer?.stop();
});
beforeEach(async () => {

View file

@ -483,7 +483,7 @@ describe('checkBalance', () => {
afterAll(async () => {
await mongoose.disconnect();
await mongoServer.stop();
await mongoServer?.stop();
});
beforeEach(async () => {

View file

@ -29,7 +29,7 @@ beforeAll(async () => {
afterAll(async () => {
await mongoose.disconnect();
await mongoServer.stop();
await mongoServer?.stop();
for (const modelName of modelsToCleanup) {
if (mongoose.models[modelName]) {
delete mongoose.models[modelName];

View file

@ -43,7 +43,7 @@ beforeAll(async () => {
afterAll(async () => {
await mongoose.disconnect();
await mongoServer.stop();
await mongoServer?.stop();
});
beforeEach(async () => {

View file

@ -2850,7 +2850,7 @@ describe('scheduled reset policy synchronization', () => {
});
afterAll(async () => {
await mongoose.disconnect();
await mongo.stop();
await mongo?.stop();
});
beforeEach(async () => {
await mongoose.connection.dropDatabase();

View file

@ -48,7 +48,7 @@ beforeAll(async () => {
afterAll(async () => {
await mongoose.disconnect();
await mongoServer.stop();
await mongoServer?.stop();
});
beforeEach(async () => {

View file

@ -35,7 +35,7 @@ beforeAll(async () => {
afterAll(async () => {
await mongoose.disconnect();
await mongoServer.stop();
await mongoServer?.stop();
});
beforeEach(async () => {

View file

@ -20,7 +20,7 @@ describe('Skill cleanup across a worker restart', () => {
afterAll(async () => {
await mongoose.disconnect();
await mongo.stop();
await mongo?.stop();
});
it('finishes a superseded committed upload without reporting successful cleanup as a lost claim', async () => {

View file

@ -57,7 +57,7 @@ beforeAll(async () => {
});
afterAll(async () => {
await mongoose.disconnect();
await server.stop();
await server?.stop();
if (originalStrict == null) delete process.env.TENANT_ISOLATION_STRICT;
else process.env.TENANT_ISOLATION_STRICT = originalStrict;
});

View file

@ -3812,7 +3812,7 @@ describe('steady-state sync of an unchanged source', () => {
afterAll(async () => {
await mongoose.disconnect();
await server.stop();
await server?.stop();
});
beforeEach(async () => {

View file

@ -52,7 +52,7 @@ beforeAll(async () => {
afterAll(async () => {
await mongoose.disconnect();
await mongo.stop();
await mongo?.stop();
});
afterEach(async () => {