Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.

Commit d985730

Browse files
authored
global-setup: extend ingestion timeout to 240s (#24)
During initial setup, ingestion of SBOMs can take longer than current 60s timeout allows. Timeout should be only safety measure here (its not a perf test, only one time pre-test setup) so increase time limit to double (in case of UI: 2min for SBOMs and 2min for Advisories). As with addition of more files we may need to increase this again in future, switching to use constant defined for it at same place as the list of files to be ingested.
1 parent 4e9ab14 commit d985730

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

tests/api/dependencies/global.setup.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import path from "path";
33

44
import { AxiosInstance } from "axios";
55

6-
import { ADVISORY_FILES, SBOM_FILES } from "../../common/constants";
6+
import {
7+
ADVISORY_FILES,
8+
SBOM_FILES,
9+
SETUP_TIMEOUT,
10+
} from "../../common/constants";
711
import { UploadSbomResponse } from "../client";
812
import { test as setup } from "../fixtures";
913

@@ -14,7 +18,7 @@ setup.describe("Ingest initial data", () => {
1418
);
1519

1620
setup("Upload files", async ({ axios }) => {
17-
setup.setTimeout(120_000);
21+
setup.setTimeout(SETUP_TIMEOUT);
1822
await uploadSboms(axios, SBOM_FILES);
1923
await uploadAdvisories(axios, ADVISORY_FILES);
2024
});

tests/common/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export const logger = {
1717
},
1818
};
1919

20+
export const SETUP_TIMEOUT = 240_000;
21+
2022
export const SBOM_FILES = [
2123
"quarkus-bom-2.13.8.Final-redhat-00004.json.bz2",
2224
"ubi8_ubi-micro-8.8-7.1696517612.json.bz2",

tests/ui/dependencies/global.setup.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import path from "path";
22
import { expect, Page, test as setup } from "@playwright/test";
33
import { login } from "../helpers/Auth";
4-
import { ADVISORY_FILES, SBOM_FILES } from "../../common/constants";
4+
import {
5+
ADVISORY_FILES,
6+
SBOM_FILES,
7+
SETUP_TIMEOUT,
8+
} from "../../common/constants";
59

610
setup.describe("Ingest initial data", () => {
711
setup.skip(
@@ -15,7 +19,7 @@ setup.describe("Ingest initial data", () => {
1519
await page.goto(baseURL!);
1620
await page.getByRole("link", { name: "Upload" }).click();
1721

18-
setup.setTimeout(120_000);
22+
setup.setTimeout(SETUP_TIMEOUT);
1923
await uploadSboms(page, SBOM_FILES);
2024
await uploadAdvisories(page, ADVISORY_FILES);
2125
});
@@ -34,7 +38,7 @@ const uploadSboms = async (page: Page, files: string[]) => {
3438
await expect(
3539
page.locator("#upload-sbom-tab-content .pf-v6-c-expandable-section__toggle")
3640
).toContainText(`${files.length} of ${files.length} files uploaded`, {
37-
timeout: 60_000,
41+
timeout: SETUP_TIMEOUT / 2,
3842
});
3943
};
4044

@@ -53,6 +57,6 @@ const uploadAdvisories = async (page: Page, files: string[]) => {
5357
"#upload-advisory-tab-content .pf-v6-c-expandable-section__toggle"
5458
)
5559
).toContainText(`${files.length} of ${files.length} files uploaded`, {
56-
timeout: 60_000,
60+
timeout: SETUP_TIMEOUT / 2,
5761
});
5862
};

0 commit comments

Comments
 (0)