Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(e2e): stop the WRC port-forward process itself in the contracts journey

Alfredo Lopez09af4f46fd33
diff --git a/scripts/e2e/e2e-wrc-hcc-contracts.sh b/scripts/e2e/e2e-wrc-hcc-contracts.sh
index 570f0f923..71f650fe9 100755
--- a/scripts/e2e/e2e-wrc-hcc-contracts.sh
+++ b/scripts/e2e/e2e-wrc-hcc-contracts.sh
@@ -70,7 +70,16 @@ require_command() {
start_wrc_port_forward() {
WRC_PF_LOG="$(mktemp "${TMPDIR:-/tmp}/wrc-port-forward.XXXXXX.log")"
- kctl -n "$CONTROL_NS" port-forward svc/workflow-recipes :8082 >"$WRC_PF_LOG" 2>&1 &
+ # Start kubectl itself, not the kctl function: a backgrounded function runs in
+ # a subshell, so $! would be that subshell and stop_wrc_port_forward would leave
+ # kubectl running as an orphan with no ownership record.
+ if [ -n "$E2E_KUBECONTEXT" ]; then
+ "$KUBECTL_BIN" --context "$E2E_KUBECONTEXT" -n "$CONTROL_NS" \
+ port-forward svc/workflow-recipes :8082 >"$WRC_PF_LOG" 2>&1 &
+ else
+ "$KUBECTL_BIN" -n "$CONTROL_NS" \
+ port-forward svc/workflow-recipes :8082 >"$WRC_PF_LOG" 2>&1 &
+ fi
WRC_PF_PID=$!
for _ in $(seq 1 80); do