diff --git a/src/test/access-write-back.property.test.ts b/src/test/access-write-back.property.test.ts index d111b88..6a4d973 100644 --- a/src/test/access-write-back.property.test.ts +++ b/src/test/access-write-back.property.test.ts @@ -8,6 +8,7 @@ import { } from "../config"; import { writeAccess } from "../service/connectionState"; import { writerCalls } from "./writerCalls"; +import { LOADED_HOST_TIMEOUT_MS } from "./helpers/timeouts"; const original = getModuleConfig(); const SEED = Number(process.env.FC_SEED ?? 20261116); @@ -77,7 +78,9 @@ const neighbours = fc.array( { maxLength: 6 }, ); -describe("[property] external access write-back", () => { +describe("[property] external access write-back", function () { + this.timeout(LOADED_HOST_TIMEOUT_MS); + afterEach(() => setModuleConfig(original)); it("sends the configuration writer the input with only the target's access replaced, whatever the other entries hold, and never throws", async () => { diff --git a/src/test/config.journeys.test.ts b/src/test/config.journeys.test.ts index aeb8a57..cbbc48e 100644 --- a/src/test/config.journeys.test.ts +++ b/src/test/config.journeys.test.ts @@ -4,6 +4,7 @@ import { getModuleConfig, setModuleConfig } from "../config"; import { callDatabase } from "./helpers/http"; import { objectsAt, text } from "./helpers/pick"; import { createOwnerSession, type OwnerSession } from "./ownerSession"; +import { LOADED_HOST_TIMEOUT_MS } from "./helpers/timeouts"; /** * The schemas whose badge each journey reads, with the label and tone the Overview feed must give them under the @@ -74,7 +75,9 @@ async function badges( ); } -describe("[integration] config journeys", () => { +describe("[integration] config journeys", function () { + this.timeout(LOADED_HOST_TIMEOUT_MS); + let owner: OwnerSession; before(async () => { diff --git a/src/test/connection-access.test.ts b/src/test/connection-access.test.ts index 3f28079..32fbdc0 100644 --- a/src/test/connection-access.test.ts +++ b/src/test/connection-access.test.ts @@ -29,6 +29,7 @@ import { getModuleConfig, setModuleConfig } from "../config"; import { configuredAccess } from "../connectionAccess"; import { isObject } from "../utils/guards"; import { type OwnerSession, createOwnerSession } from "./ownerSession"; +import { LOADED_HOST_TIMEOUT_MS } from "./helpers/timeouts"; const TABLE = "connection-access-countries"; const API = "http://127.0.0.1:5023/api/connection-access"; @@ -92,7 +93,9 @@ export class UnlistedCountries extends MappedCountries( "/api/connection-access/unlisted", ) {} -describe("[integration] a table mapped from an external connection", () => { +describe("[integration] a table mapped from an external connection", function () { + this.timeout(LOADED_HOST_TIMEOUT_MS); + let owner: OwnerSession; const send = (method: string, url: string, body?: { name: string }) => diff --git a/src/test/data.journeys.test.ts b/src/test/data.journeys.test.ts index 17c80b6..485ce51 100644 --- a/src/test/data.journeys.test.ts +++ b/src/test/data.journeys.test.ts @@ -11,6 +11,7 @@ import { import { callDatabase } from "./helpers/http"; import { pick } from "./helpers/pick"; import { createMemberSession } from "./ownerSession"; +import { LOADED_HOST_TIMEOUT_MS } from "./helpers/timeouts"; async function assertInstancePicker(api: DataApi): Promise { const instances = async (query: string) => { @@ -332,7 +333,9 @@ async function assertOwnerOnly(api: DataApi): Promise { } } -describe("[integration] data journeys", () => { +describe("[integration] data journeys", function () { + this.timeout(LOADED_HOST_TIMEOUT_MS); + const api = withDataFixture("data-journeys-owner@example.test"); it("the-instance-picker-lists-named-instances-with-a-search-and-a-limit", () => diff --git a/src/test/diagram-routes.test.ts b/src/test/diagram-routes.test.ts index d7bc038..0f82a84 100644 --- a/src/test/diagram-routes.test.ts +++ b/src/test/diagram-routes.test.ts @@ -6,6 +6,7 @@ import { DatabaseDiagramController } from "../routes/diagram"; import { OWN_CONNECTION } from "../types/constants"; import type { JsonValue } from "../types/json"; import { refusal } from "./refusal"; +import { LOADED_HOST_TIMEOUT_MS } from "./helpers/timeouts"; const SCHEMA_NAME = "diagram-routes-shop"; const OTHER_SCHEMA_NAME = "diagram-routes-other"; @@ -43,7 +44,9 @@ function withCleanTables(): void { after(clearAll); } -describe("[integration] diagram layout routes", () => { +describe("[integration] diagram layout routes", function () { + this.timeout(LOADED_HOST_TIMEOUT_MS); + withCleanTables(); it("answers an empty layout for a schema that has none", async () => { diff --git a/src/test/editing.journeys.test.ts b/src/test/editing.journeys.test.ts index 1463196..c6144ce 100644 --- a/src/test/editing.journeys.test.ts +++ b/src/test/editing.journeys.test.ts @@ -14,6 +14,7 @@ import { import { callDatabase, type HttpAnswer } from "./helpers/http"; import { pick } from "./helpers/pick"; import { createOwnerSession, type OwnerSession } from "./ownerSession"; +import { LOADED_HOST_TIMEOUT_MS } from "./helpers/timeouts"; const SHOP = "editing-journeys-shop"; const ID = "eu_ord_10405"; @@ -176,7 +177,9 @@ async function assertRefusals(session: OwnerSession): Promise { assert.match(missing.text, /Row not found/); } -describe("[integration] editing journeys", () => { +describe("[integration] editing journeys", function () { + this.timeout(LOADED_HOST_TIMEOUT_MS); + let owner: OwnerSession; before(async () => { diff --git a/src/test/external-access.test.ts b/src/test/external-access.test.ts index 5cd6401..e9ba21c 100644 --- a/src/test/external-access.test.ts +++ b/src/test/external-access.test.ts @@ -12,6 +12,7 @@ import { writeAccess } from "../service/connectionState"; import { keyedRefusal, refusal } from "./refusal"; import { queryContext } from "./requestContext"; import { answerNextWrite, writerCalls } from "./writerCalls"; +import { LOADED_HOST_TIMEOUT_MS } from "./helpers/timeouts"; const controller = new DatabaseConnectionsController(); const browse = new DatabaseBrowseController(); @@ -43,7 +44,9 @@ async function accessOf(connection: string): Promise { return connections.find(({ id }) => id === connection)?.access; } -describe("[integration] external connections: changing access", () => { +describe("[integration] external connections: changing access", function () { + this.timeout(LOADED_HOST_TIMEOUT_MS); + beforeEach(() => setModuleConfig({ ...original, externalConnections: {} })); afterEach(() => setModuleConfig(original)); diff --git a/src/test/helpers/timeouts.ts b/src/test/helpers/timeouts.ts new file mode 100644 index 0000000..e98eaa9 --- /dev/null +++ b/src/test/helpers/timeouts.ts @@ -0,0 +1,5 @@ +/** Budget for a test or hook that talks to the in-memory MongoDB and the booted DMS on a host that is busy or slow. */ +export const LOADED_HOST_TIMEOUT_MS = 30_000; + +/** Budget for a hook that seeds a fixture, which also waits on the first DMS boot and MongoDB download on a slow runner. */ +export const SEED_HOOK_TIMEOUT_MS = 120_000; diff --git a/src/test/redesign.test.ts b/src/test/redesign.test.ts index 28e7a17..bc1dad9 100644 --- a/src/test/redesign.test.ts +++ b/src/test/redesign.test.ts @@ -25,6 +25,7 @@ import { listRowReferences } from "../service/references"; import { isObject, isRecord } from "../utils/guards"; import { queryContext } from "./requestContext"; import { encode } from "./stagedWire"; +import { SEED_HOOK_TIMEOUT_MS } from "./helpers/timeouts"; const SCHEMA = "redesign-shop"; const INSTANCE = "eu"; @@ -118,7 +119,10 @@ async function cleanUp(): Promise { .run(); } -before(seed); +before(async function () { + this.timeout(SEED_HOOK_TIMEOUT_MS); + await seed(); +}); after(cleanUp); describe("[integration] v2 redesign: browsing", () => { diff --git a/src/test/schemas-page.test.ts b/src/test/schemas-page.test.ts index bf9bd18..b7d5bdc 100644 --- a/src/test/schemas-page.test.ts +++ b/src/test/schemas-page.test.ts @@ -15,6 +15,7 @@ import { parseHasFlags, readSchemaFilters, } from "../service/schemaFilters"; +import { SEED_HOOK_TIMEOUT_MS } from "./helpers/timeouts"; /** * The Schemas page: rows counted across instances (S-7), columns holding @@ -84,7 +85,10 @@ async function cleanUp(): Promise { } describe("[integration] Schemas page", () => { - before(seed); + before(async function () { + this.timeout(SEED_HOOK_TIMEOUT_MS); + await seed(); + }); after(cleanUp); /** The source as the table view calls it, with the bar's hidden filters. */