Uh oh!
There was an error while loading. Please reload this page.
ci(windows-e2e): stop the teardown net failing open - #551
Conversation
Bugbot, release-train staging hop #542, High. The always() safety-net teardown ran k3d cluster delete via Start-Process with no -ErrorAction Stop and no null-check on $p, inside an empty catch, and the inline step did not set $ErrorActionPreference. A SPAWN failure left $p null, $p.HasExited threw into the empty catch, and the shared runner kept a leftover tbe2ewin cluster -- the exact state this net exists to clear, and the one that sends the next run's New-K3dCluster down its reuse path for a false PASS with no real create. Now: ErrorActionPreference=Stop, an explicit null-check, a timeout-kill that surfaces rather than hides, and an exit-code check. On any failure it does NOT fail the run (this is always() teardown, the run is over) but emits a ::warning:: naming the stale cluster and the manual fix, so a leftover can never be silent again. Refs: tracebloc/backend#1426
shujaatTracebloc
left a comment
There was a problem hiding this comment.
Reviewed and verified locally.
The rewrite fully closes the fail-open: with $ErrorActionPreference = 'Stop' plus the explicit if ($null -eq $p) throw guard, a Start-Process spawn failure can no longer leave $p null and blow up $p.HasExited inside an empty catch — the exact path that let a stale tbe2ewin cluster survive unseen. Timeout (force-kill → throw), non-zero exit code, and null-process are each surfaced; on any of them the always() step emits a ::warning:: naming the cluster and the manual k3d cluster delete remedy rather than swallowing it, and correctly does not fail the already-finished run.
Checked the edges:
k3d cluster deleteis idempotent (exit 0 when the cluster is absent, per #544), so a teardown running after the driver's own finally already deleted the cluster exits 0 → logs 'deleted', no spurious warning.$ErrorActionPreferenceis scoped to this run: step (fresh shell per step, no leak).- The deferred data-dir
Remove-Itemstays outside the try/catch and still always runs; its per-command-ErrorAction SilentlyContinueoverrides the Stop preference.
windows-e2e.yaml parses as valid YAML; teardown step is guarded by if: always(). All CI green incl. Cursor Bugbot; no open review threads. Correct that the heavy E2E/Prereqs jobs are path-filtered out for a workflow-only change. LGTM.
Uh oh!
There was an error while loading. Please reload this page.
LukasWodka
commented
Aug 3, 2026
/fr-pass |
The
always()safety-net teardown rank3d cluster deleteviaStart-Processwith no-ErrorAction Stop, no null-check on$p, inside an empty catch, and the step never set$ErrorActionPreference.So a spawn failure left
$pnull →$p.HasExitedthrew → the empty catch ate it → the shared runner kept a leftovertbe2ewincluster. That is the exact state this net exists to clear, and the one that sends the next run'sNew-K3dClusterdown its reuse path for a false PASS with no real create — the same false-green class as#544, one layer up in the workflow rather than the driver script.Fix:
$ErrorActionPreference = 'Stop', explicit null-check, a timeout-kill that surfaces instead of hiding, and an exit-code check. On failure it does not fail the run — this isalways()teardown and the run is already over — but emits a::warning::naming the stale cluster and the manual remedy, so a leftover can never be silent again.Found by Bugbot on the release-train staging hop (
client#542), High.Refs: tracebloc/backend#1426
🤖 Generated with Claude Code
Note
Low Risk
CI-only PowerShell in an
always()teardown step; behavior change is better observability and stricter delete validation without altering the main e2e driver or installer.Overview
The Windows e2e
always()teardown step no longer fails open whenk3d cluster deletedoes not actually run or finish.It sets
$ErrorActionPreference = 'Stop', validates thatStart-Processreturned a process, treats 120s timeout + kill and non-zero exit as failures instead of swallowing them, and replaces the emptycatchwith a::warning::that namestbe2ewin, the reuse-path false-pass risk, and the manual delete command. Successful deletes log confirmation; the step still does not fail the job on teardown errors.Reviewed by Cursor Bugbot for commit 9020bbb. Bugbot is set up for automated code reviews on this repo. Configure here.