Skip to content

Commit 4501fba

Browse files
committed
refactor: add timeouts to vitest hooks
Specifically the cleanup and init hooks. The default timeout is 10s. We create so many dbs in the tests that timeout can take a while. This makes the tests less flakey.
1 parent aa101fc commit 4501fba

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

apps/e2e/tests/backend/endpoints/api/v1/external-db-sync-advanced.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ describe.sequential('External DB Sync - Advanced Tests', () => {
3535
beforeAll(async () => {
3636
dbManager = new TestDbManager();
3737
await dbManager.init();
38-
});
38+
}, 30000); // 30 second timeout for init
3939

4040
afterAll(async () => {
4141
await dbManager.cleanup();
42-
});
42+
}, 60000); // 60 second timeout for cleanup
4343

4444
/**
4545
* What it does:

apps/e2e/tests/backend/endpoints/api/v1/external-db-sync-basics.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ describe.sequential('External DB Sync - Basic Tests', () => {
3030
beforeAll(async () => {
3131
dbManager = new TestDbManager();
3232
await dbManager.init();
33-
});
33+
}, 30000); // 30 second timeout for init
3434

3535
afterAll(async () => {
3636
await dbManager.cleanup();
37-
});
37+
}, 60000); // 60 second timeout for cleanup
3838

3939
/**
4040
* What it does:

apps/e2e/tests/backend/endpoints/api/v1/external-db-sync-high-volume.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ describe.sequential('External DB Sync - High Volume Tests', () => {
3030
beforeAll(async () => {
3131
dbManager = new TestDbManager();
3232
await dbManager.init();
33-
});
33+
}, 30000); // 30 second timeout for init
3434

3535
afterAll(async () => {
3636
await dbManager.cleanup();

apps/e2e/tests/backend/endpoints/api/v1/external-db-sync-race.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ describe.sequential('External DB Sync - Race Condition Tests', () => {
3131
beforeAll(async () => {
3232
dbManager = new TestDbManager();
3333
await dbManager.init();
34-
});
34+
}, 30000); // 30 second timeout for init
3535

3636
afterAll(async () => {
3737
await dbManager.cleanup();
38-
});
38+
}, 60000); // 60 second timeout for cleanup
3939

4040
/**
4141
* What it does:

0 commit comments

Comments
 (0)