Skip to content

The open-source app everyone uses to manage agents at work

fix(db): give the last two embedded-Postgres migration tests a timeout (#11313)

Tonio1e07d5b9aae4
diff --git a/packages/db/src/company-secret-proposals-migration.test.ts b/packages/db/src/company-secret-proposals-migration.test.ts
index 52d9a96a4a..b358551ccc 100644
--- a/packages/db/src/company-secret-proposals-migration.test.ts
+++ b/packages/db/src/company-secret-proposals-migration.test.ts
@@ -24,6 +24,11 @@ if (!embeddedPostgresSupport.supported) {
describeEmbeddedPostgres("company secret proposals migration", () => {
afterEach(async () => Promise.all(cleanups.splice(0).map((cleanup) => cleanup())));
+ // Starting an embedded Postgres and replaying a migration against it does not
+ // fit vitest's 5s default: the neighbouring replay suites measure 7-12s on
+ // CI. Every other embedded-Postgres migration test in this package carries an
+ // explicit timeout for that reason; this one did not, so it failed on any
+ // runner that was not unusually fast.
it("can be reapplied after its migration journal entry is removed", async () => {
const database = await startEmbeddedPostgresTestDatabase("paperclip-secret-proposals-migration-");
cleanups.push(database.cleanup);
@@ -40,5 +45,5 @@ describeEmbeddedPostgres("company secret proposals migration", () => {
(SELECT count(*)::int FROM pg_indexes WHERE tablename = 'company_secret_proposals') AS indexes
`;
expect(result).toEqual({ constraints: 13, indexes: 5 });
- });
+ }, 30_000);
});
diff --git a/packages/db/src/status-card-migrations.test.ts b/packages/db/src/status-card-migrations.test.ts
index 87b0f5072e..6e049d2a70 100644
--- a/packages/db/src/status-card-migrations.test.ts
+++ b/packages/db/src/status-card-migrations.test.ts
@@ -22,6 +22,10 @@ describeEmbeddedPostgres("status card migrations", () => {
await Promise.all(cleanups.splice(0).map((cleanup) => cleanup()));
});
+ // Same reason as every other embedded-Postgres migration test here: starting
+ // the server and replaying migrations against it does not fit vitest's 5s
+ // default. This suite has not tripped yet only because it replays fewer
+ // statements than its neighbours — it is the same latent failure.
it("can be reapplied after the schema already exists", async () => {
const database = await startEmbeddedPostgresTestDatabase("paperclip-status-card-migrations-");
cleanups.push(database.cleanup);
@@ -35,5 +39,5 @@ describeEmbeddedPostgres("status card migrations", () => {
);
await sql.unsafe(migrationSql);
}
- });
+ }, 30_000);
});