From 0c2b81de3a9084450b33b1c511c149195919c7ad Mon Sep 17 00:00:00 2001 From: Andy Pickering Date: Thu, 18 Jun 2026 09:12:26 +0900 Subject: [PATCH 1/2] Tests: Add wait for cluster API to become available --- tests/support/fixtures.ts | 4 ++-- tests/support/global-setup.ts | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/tests/support/fixtures.ts b/tests/support/fixtures.ts index 259f1ee6..f87b2395 100644 --- a/tests/support/fixtures.ts +++ b/tests/support/fixtures.ts @@ -66,10 +66,10 @@ data: {"event": "end", "data": {"referenced_documents": [], "truncated": false}} type Attachment = { attachment_type: string; content_type: string }; -export const oc = (args: string[]): string => +export const oc = (args: string[], timeout = 180_000): string => execFileSync('oc', [...args, '--kubeconfig', process.env.KUBECONFIG_PATH!], { encoding: 'utf-8', - timeout: 180_000, + timeout, }); const ARTIFACTS_DIR = './gui_test_screenshots/artifacts'; diff --git a/tests/support/global-setup.ts b/tests/support/global-setup.ts index 6a0e66ff..1d732f60 100644 --- a/tests/support/global-setup.ts +++ b/tests/support/global-setup.ts @@ -17,6 +17,26 @@ const globalSetup = async (config: FullConfig) => { fs.mkdirSync(AUTH_DIR, { recursive: true }); + // Wait for the cluster API to become reachable before proceeding + const MAX_RETRIES = 360; + const RETRY_DELAY_S = 10; + for (let attempt = 1; attempt <= MAX_RETRIES; attempt++) { + try { + oc(['version'], 10_000); + break; + } catch (err: unknown) { + if (attempt === MAX_RETRIES) { + console.error('Cluster API not reachable after retries'); + throw err; + } + console.warn( + `Cluster not reachable (attempt ${attempt}/${MAX_RETRIES}), ` + + `retrying in ${RETRY_DELAY_S}s`, + ); + execSync(`sleep ${RETRY_DELAY_S}`); + } + } + oc(['adm', 'policy', 'add-cluster-role-to-user', 'cluster-admin', username]); oc(['adm', 'policy', 'add-cluster-role-to-user', 'lightspeed-operator-query-access', username]); From 8547a6445c50644029d38b5da2ca139e116970c7 Mon Sep 17 00:00:00 2001 From: Andy Pickering Date: Thu, 18 Jun 2026 21:46:20 +0900 Subject: [PATCH 2/2] Increase clusterClaim timeout to 3h --- .tekton/integration-tests/lightspeed-console-pre-commit.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.tekton/integration-tests/lightspeed-console-pre-commit.yaml b/.tekton/integration-tests/lightspeed-console-pre-commit.yaml index 51a91d16..5b23d063 100644 --- a/.tekton/integration-tests/lightspeed-console-pre-commit.yaml +++ b/.tekton/integration-tests/lightspeed-console-pre-commit.yaml @@ -65,7 +65,7 @@ spec: }, "owner": "obs", "product": "ocp", - "timeout": "1h30m0s", + "timeout": "3h0m0s", "version": "4.22" } runAfter: