@@ -19,11 +19,30 @@ openclaw_e2e_eval_test_state_from_b64 "${OPENCLAW_TEST_STATE_SCRIPT_B64:?missing
|
19 | 19 | probe="scripts/e2e/lib/bundled-plugin-install-uninstall/probe.mjs" |
20 | 20 | runtime_smoke="scripts/e2e/lib/bundled-plugin-install-uninstall/runtime-smoke.mjs" |
21 | 21 | node "$probe" select > /tmp/bundled-plugin-sweep-ids |
| 22 | +sweep_command_timeout="${OPENCLAW_BUNDLED_PLUGIN_SWEEP_COMMAND_TIMEOUT:-300s}" |
22 | 23 | |
23 | 24 | now_ms() { |
24 | 25 | node -e 'process.stdout.write(String(Date.now()))' |
25 | 26 | } |
26 | 27 | |
| 28 | +run_logged_sweep_command() { |
| 29 | +local label="$1" |
| 30 | +local log_file="$2" |
| 31 | +shift 2 |
| 32 | +if openclaw_e2e_maybe_timeout "$sweep_command_timeout" "$@" >"$log_file" 2>&1; then |
| 33 | +return 0 |
| 34 | +else |
| 35 | +local status=$? |
| 36 | + cat "$log_file" |
| 37 | +if [ "$status" -eq 124 ]; then |
| 38 | +echo "Bundled plugin sweep command timed out after $sweep_command_timeout: $label" >&2 |
| 39 | +else |
| 40 | +echo "Bundled plugin sweep command failed with status $status: $label" >&2 |
| 41 | +fi |
| 42 | +return "$status" |
| 43 | +fi |
| 44 | +} |
| 45 | + |
27 | 46 | lifecycle_trace_enabled() { |
28 | 47 | case "${OPENCLAW_PLUGIN_LIFECYCLE_TRACE:-}" in |
29 | 48 | 1 | true | TRUE | yes | YES) |
@@ -53,10 +72,8 @@ for plugin_entry in "${plugin_entries[@]}"; do
|
53 | 72 | uninstall_log="/tmp/openclaw-uninstall-${plugin_index}.log" |
54 | 73 | plugin_started_at="$(now_ms)" |
55 | 74 | echo "Installing bundled plugin: $plugin_id ($plugin_dir)" |
56 | | - node "$OPENCLAW_ENTRY" plugins install "$plugin_id" >"$install_log" 2>&1 || { |
57 | | - cat "$install_log" |
58 | | -exit 1 |
59 | | - } |
| 75 | + run_logged_sweep_command "install $plugin_id" "$install_log" \ |
| 76 | + node "$OPENCLAW_ENTRY" plugins install "$plugin_id" |
60 | 77 | if lifecycle_trace_enabled; then |
61 | 78 | cat "$install_log" |
62 | 79 | fi |
@@ -74,10 +91,8 @@ for plugin_entry in "${plugin_entries[@]}"; do
|
74 | 91 | runtime_finished_at="$(now_ms)" |
75 | 92 | |
76 | 93 | echo "Uninstalling bundled plugin: $plugin_id ($plugin_dir)" |
77 | | - node "$OPENCLAW_ENTRY" plugins uninstall "$plugin_id" --force >"$uninstall_log" 2>&1 || { |
78 | | - cat "$uninstall_log" |
79 | | -exit 1 |
80 | | - } |
| 94 | + run_logged_sweep_command "uninstall $plugin_id" "$uninstall_log" \ |
| 95 | + node "$OPENCLAW_ENTRY" plugins uninstall "$plugin_id" --force |
81 | 96 | if lifecycle_trace_enabled; then |
82 | 97 | cat "$uninstall_log" |
83 | 98 | fi |
|