diff --git a/scripts/src/hwlab-node-impl.ts b/scripts/src/hwlab-node-impl.ts index 2a7b39be..4214d3a3 100644 --- a/scripts/src/hwlab-node-impl.ts +++ b/scripts/src/hwlab-node-impl.ts @@ -2976,7 +2976,7 @@ function nodeRuntimeCicdWaitWarning(spec: HwlabRuntimeLaneSpec, pipelineRun: str const wait = record(pipelineWait); return { code: "node-runtime-cicd-wait-over-120s", - message: `PipelineRun ${pipelineRun} is still active after ${NODE_RUNTIME_CICD_WAIT_WARNING_SECONDS}s; CICD command stopped waiting and left the deployment running.`, + message: `PipelineRun ${pipelineRun} is still non-terminal after ${NODE_RUNTIME_CICD_WAIT_WARNING_SECONDS}s; this is a severe timeout and requires further investigation of Tekton TaskRuns/Pods instead of treating it as normal wait time.`, waitedSeconds: NODE_RUNTIME_CICD_WAIT_WARNING_SECONDS, elapsedMs: wait.elapsedMs ?? null, polls: wait.polls ?? null, @@ -6261,6 +6261,29 @@ function waitForNodeRuntimePipelineRunTerminal( lastOpportunisticPostFlushAt = Date.now(); const flush = options.opportunisticPostFlush(); if (flush !== null) opportunisticPostFlushes.push(flush); + last = getNodeRuntimePipelineRun(spec, pipelineRun); + const refreshedStatus = typeof last.status === "string" ? last.status : null; + const refreshedReason = typeof last.reason === "string" ? last.reason : null; + const refreshedElapsedMs = Date.now() - startedAt; + if (refreshedStatus === "True" || refreshedStatus === "False") { + const ok = refreshedStatus === "True"; + const diagnostics = ok ? null : nodeRuntimePipelineRunDiagnostics(spec, pipelineRun); + const failureSummary = nodeRuntimePipelineFailureSummary(diagnostics); + printNodeRuntimeTriggerProgress(spec, { stage: "pipelinerun-wait", status: ok ? "succeeded" : "failed", pipelineRun, pipelineStatus: refreshedStatus, reason: refreshedReason, polls, elapsedMs: refreshedElapsedMs, observedAfterPostFlush: true }); + return { + ok, + status: ok ? "succeeded" : "failed", + pipelineRun: last, + diagnostics, + failureSummary, + polls, + elapsedMs: refreshedElapsedMs, + opportunisticPostSyncs: opportunisticPostSyncs.length > 0 ? opportunisticPostSyncs : undefined, + opportunisticPostFlushes: opportunisticPostFlushes.length > 0 ? opportunisticPostFlushes : undefined, + observedAfterPostFlush: true, + degradedReason: ok ? undefined : "node-runtime-pipelinerun-failed", + }; + } } sleepSync(Math.min(10_000, Math.max(1000, deadline - Date.now()))); }