From b40712428facb0fa1287e56597ab7be801415822 Mon Sep 17 00:00:00 2001 From: Codex Date: Fri, 26 Jun 2026 14:40:53 +0000 Subject: [PATCH] fix(web-probe): reduce sentinel wait polling latency --- scripts/src/hwlab-node-web-sentinel-cicd.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/src/hwlab-node-web-sentinel-cicd.ts b/scripts/src/hwlab-node-web-sentinel-cicd.ts index e045c5cb..4e2f6cb3 100644 --- a/scripts/src/hwlab-node-web-sentinel-cicd.ts +++ b/scripts/src/hwlab-node-web-sentinel-cicd.ts @@ -814,10 +814,10 @@ function collectSentinelObservedStatus(state: SentinelCicdState, timeoutSeconds: function waitForSentinelObservedStatus(state: SentinelCicdState, timeoutSeconds: number, expectation?: SentinelObservedExpectation): SentinelObservedStatus { const startedAt = Date.now(); - const timeoutMs = Math.max(5_000, Math.min(timeoutSeconds * 1000, controlPlaneWaitWarningSeconds(state) * 1000)); + const timeoutMs = Math.max(1_000, Math.min(timeoutSeconds * 1000, controlPlaneWaitWarningSeconds(state) * 1000)); let observed = collectSentinelObservedStatus(state, timeoutSeconds, expectation); while (!sentinelObservedReady(observed) && Date.now() - startedAt < timeoutMs) { - runCommand(["sleep", "5"], repoRoot, { timeoutMs: 6_000 }); + runCommand(["sleep", "2"], repoRoot, { timeoutMs: 3_000 }); observed = collectSentinelObservedStatus(state, timeoutSeconds, expectation); } return observed; @@ -1011,7 +1011,7 @@ function runSentinelSourceMirrorSyncJob(state: SentinelCicdState, timeoutSeconds slowWarningSent = true; sentinelProgressEvent("sentinel.source-mirror.warning", { warning: `source mirror sync exceeded configured ${Math.round(warningBudgetMs / 1000)}s timing budget; non-blocking timing alert`, jobName, elapsedMs: Date.now() - startedAt, node: state.spec.nodeId, lane: state.spec.lane }); } - runCommand(["sleep", "5"], repoRoot, { timeoutMs: 6_000 }); + runCommand(["sleep", "2"], repoRoot, { timeoutMs: 3_000 }); } return { ok: false, phase: "job-timeout", jobName, payload: { ok: false, status: "timeout", valuesRedacted: true }, polls, elapsedMs: Date.now() - startedAt, probe: lastProbe, valuesRedacted: true }; } @@ -1255,7 +1255,7 @@ function runSentinelPublishJob(state: SentinelCicdState, publishGitops: boolean, slowWarningSent = true; sentinelProgressEvent("sentinel.publish.warning", { warning: `remote publish job exceeded configured ${Math.round(warningBudgetMs / 1000)}s timing budget; non-blocking timing alert`, jobName, elapsedMs: Date.now() - startedAt, node: state.spec.nodeId, lane: state.spec.lane }); } - runCommand(["sleep", "5"], repoRoot, { timeoutMs: 6_000 }); + runCommand(["sleep", "2"], repoRoot, { timeoutMs: 3_000 }); } return { ok: false, phase: "job-timeout", jobName, payload: { ok: false, status: "timeout", valuesRedacted: true }, polls, elapsedMs: Date.now() - startedAt, probe: lastProbe, valuesRedacted: true }; }