fix(e2e): time out telegram package installs · openclaw/openclaw@a17ac3e
vincentkoc
·
2026-05-26
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -223,6 +223,7 @@ run_logged() {
|
223 | 223 | echo "Running package Telegram live Docker E2E ($PACKAGE_LABEL)..." |
224 | 224 | run_logged docker_e2e_docker_run_cmd run --rm \ |
225 | 225 | -e COREPACK_ENABLE_DOWNLOAD_PROMPT=0 \ |
| 226 | + -e OPENCLAW_E2E_NPM_INSTALL_TIMEOUT="${OPENCLAW_E2E_NPM_INSTALL_TIMEOUT:-600s}" \ |
226 | 227 | -e OPENCLAW_NPM_TELEGRAM_INSTALL_SOURCE="$package_install_source" \ |
227 | 228 | -e OPENCLAW_NPM_TELEGRAM_PACKAGE_LABEL="$PACKAGE_LABEL" \ |
228 | 229 | ${package_mount_args[@]+"${package_mount_args[@]}"} \ |
@@ -237,7 +238,16 @@ export PATH="$NPM_CONFIG_PREFIX/bin:$PATH"
|
237 | 238 | install_source="${OPENCLAW_NPM_TELEGRAM_INSTALL_SOURCE:?missing OPENCLAW_NPM_TELEGRAM_INSTALL_SOURCE}" |
238 | 239 | package_label="${OPENCLAW_NPM_TELEGRAM_PACKAGE_LABEL:-$install_source}" |
239 | 240 | echo "Installing ${package_label} from ${install_source}..." |
240 | | -npm install -g "$install_source" --no-fund --no-audit |
| 241 | + |
| 242 | +npm_install_timeout="${OPENCLAW_E2E_NPM_INSTALL_TIMEOUT:-600s}" |
| 243 | +if [ -z "$npm_install_timeout" ] || [ "$npm_install_timeout" = "0" ]; then |
| 244 | + npm install -g "$install_source" --no-fund --no-audit |
| 245 | +elif command -v timeout >/dev/null 2>&1; then |
| 246 | + timeout --foreground --kill-after=30s "$npm_install_timeout" npm install -g "$install_source" --no-fund --no-audit |
| 247 | +else |
| 248 | + echo "timeout command not found; running package install without OPENCLAW_E2E_NPM_INSTALL_TIMEOUT" >&2 |
| 249 | + npm install -g "$install_source" --no-fund --no-audit |
| 250 | +fi |
241 | 251 | |
242 | 252 | command -v openclaw |
243 | 253 | openclaw --version |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -207,6 +207,7 @@ docker_env=(
|
207 | 207 | -e OPENCLAW_NPM_TELEGRAM_WARM_SAMPLES="${OPENCLAW_NPM_TELEGRAM_WARM_SAMPLES:-20}" |
208 | 208 | -e OPENCLAW_NPM_TELEGRAM_SAMPLE_TIMEOUT_MS="${OPENCLAW_NPM_TELEGRAM_SAMPLE_TIMEOUT_MS:-30000}" |
209 | 209 | -e OPENCLAW_NPM_TELEGRAM_MAX_FAILURES="${OPENCLAW_NPM_TELEGRAM_MAX_FAILURES:-${OPENCLAW_NPM_TELEGRAM_WARM_SAMPLES:-20}}" |
| 210 | + -e OPENCLAW_E2E_NPM_INSTALL_TIMEOUT="${OPENCLAW_E2E_NPM_INSTALL_TIMEOUT:-600s}" |
210 | 211 | ) |
211 | 212 | |
212 | 213 | forward_env_if_set() { |
@@ -262,7 +263,15 @@ export PATH="$NPM_CONFIG_PREFIX/bin:$PATH"
|
262 | 263 | install_source="${OPENCLAW_NPM_TELEGRAM_INSTALL_SOURCE:?missing OPENCLAW_NPM_TELEGRAM_INSTALL_SOURCE}" |
263 | 264 | package_label="${OPENCLAW_NPM_TELEGRAM_PACKAGE_LABEL:-$install_source}" |
264 | 265 | |
265 | | -npm install -g "$install_source" --no-fund --no-audit |
| 266 | +npm_install_timeout="${OPENCLAW_E2E_NPM_INSTALL_TIMEOUT:-600s}" |
| 267 | +if [ -z "$npm_install_timeout" ] || [ "$npm_install_timeout" = "0" ]; then |
| 268 | + npm install -g "$install_source" --no-fund --no-audit |
| 269 | +elif command -v timeout >/dev/null 2>&1; then |
| 270 | + timeout --foreground --kill-after=30s "$npm_install_timeout" npm install -g "$install_source" --no-fund --no-audit |
| 271 | +else |
| 272 | + echo "timeout command not found; running package install without OPENCLAW_E2E_NPM_INSTALL_TIMEOUT" >&2 |
| 273 | + npm install -g "$install_source" --no-fund --no-audit |
| 274 | +fi |
266 | 275 | command -v openclaw |
267 | 276 | openclaw --version |
268 | 277 | node -p "require('/npm-global/lib/node_modules/openclaw/package.json').version" |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -40,6 +40,12 @@ describe("package Telegram live Docker E2E", () => {
|
40 | 40 | |
41 | 41 | expect(installRunStart).toBeGreaterThanOrEqual(0); |
42 | 42 | expect(installRunEnd).toBeGreaterThan(installRunStart); |
| 43 | +expect(installRun).toContain( |
| 44 | +'-e OPENCLAW_E2E_NPM_INSTALL_TIMEOUT="${OPENCLAW_E2E_NPM_INSTALL_TIMEOUT:-600s}"', |
| 45 | +); |
| 46 | +expect(installRun).toContain( |
| 47 | +'timeout --foreground --kill-after=30s "$npm_install_timeout" npm install -g "$install_source" --no-fund --no-audit', |
| 48 | +); |
43 | 49 | expect(installRun).toContain('npm install -g "$install_source" --no-fund --no-audit'); |
44 | 50 | expect(installRun).toContain('"${package_mount_args[@]}"'); |
45 | 51 | expect(installRun).not.toContain('"${docker_env[@]}"'); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -143,6 +143,12 @@ describe("RTT harness", () => {
|
143 | 143 | expect(installEnvSnapshotIndex).toBeGreaterThanOrEqual(0); |
144 | 144 | expect(convexSecretForwardIndex).toBeGreaterThan(installEnvSnapshotIndex); |
145 | 145 | expect(packageInstallIndex).toBeLessThan(credentialAcquireIndex); |
| 146 | +expect(script).toContain( |
| 147 | +'-e OPENCLAW_E2E_NPM_INSTALL_TIMEOUT="${OPENCLAW_E2E_NPM_INSTALL_TIMEOUT:-600s}"', |
| 148 | +); |
| 149 | +expect(script).toContain( |
| 150 | +'timeout --foreground --kill-after=30s "$npm_install_timeout" npm install -g "$install_source" --no-fund --no-audit', |
| 151 | +); |
146 | 152 | expect(script).toContain("run_logged docker_e2e_docker_run_cmd run --rm"); |
147 | 153 | expect(script).not.toContain("run_logged docker run --rm"); |
148 | 154 | expect(heartbeatStartIndex).toBeGreaterThan(sourceIndex); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。