Repository navigation
perf(test): empty shared k3d storage in lane cleanup instead of a per-file wait - #3392
Conversation
…wait kubernetes-compute-real and kubernetes-compute-provisioning-real ended with an after hook that polled every 500 ms until local-path had deleted the volumes of the namespaces their cases deleted. It existed only for lane cleanup: local-path writes each claim's directory into the lane's shared storage as root, and a directory left behind made the runner user's rm fail with EACCES (ac5abda). It cost about 13 s at the end of kubernetes-compute-real, which sets the k3d Fixture and Configuration lane's length. Lane cleanup now empties <directory>/storage itself after deleting the cluster, as root, from the cluster's own node image (--pull=never, --network=none), so no file waits. deleteNamespaces becomes a plain helper. A ci-cleanup case pins the order and the root removal; without the new step it fails with the old EACCES.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
harness-workspace-released-k3d waited up to 180 s after its case for local-path to remove its uid-1000 volume from the shared storage, for the same lane-cleanup reason as the other two files. Lane cleanup now empties that storage as root, so the case only deletes its namespace. Review nits: the root container disables SELinux labelling (the k3d nodes are privileged, it is not), and the existing k3d cleanup case now has an empty storage directory and checks that no container is started for it (dropping the empty check fails it).
|
Codex review: needs maintainer review before merge. What this changesThis PR removes two file-level volume waits and empties leftover shared storage after deleting the owned k3d cluster. Example: A fixture leaves storage/pvc-1_tenant_workspace/state behind.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open for maintainer landing: it replaces a cleanup-only wait with focused lane cleanup, and no actionable correctness or security defect was found. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherCI preparation records a disposable cluster, node image, and shared storage directory; lane cleanup consumes that record, deletes owned cluster resources, and removes the directory. flowchart TB
A[Fixture tests] --> B[Delete test namespaces]
B --> C[Lane cleanup]
C --> D[Delete and verify owned cluster]
D --> E[Empty leftover shared storage]
E --> F[Remove cluster directory]
Technical reviewBest possible solution: Keep disposable storage cleanup in the existing lane cleanup owner and remove the redundant per-file waits. Do we have a high-confidence way to reproduce the issue? This is a performance improvement; source confirms the existing polling path, and the earlier merged PR records the cleanup permission failure it prevents. Is this the best way to solve the issue? The change addresses the cleanup requirement at its existing owner, preserves cluster-absence checks, and removes the replaced polling path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a3b7d0111095. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 23, 2026, 10:39 PM ET / October 24, 2026, 02:39 UTC. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Problem
kubernetes-compute-real,kubernetes-compute-provisioning-realandharness-workspace-released-k3dwait at their end for local-path to delete the volumes of namespaces their cases deleted. The waits exist only for lane cleanup (ac5abda): local-path writes each claim's directory into the lane's shared storage (<cluster dir>/storage, bound into every node) as root or uid 1000, and a directory left behind made the runner user'srmfail with EACCES. No product code is involved: the tests delete the namespaces, and Kubernetes and local-path delete the volumes.kubernetes-compute-realsets the length of the k3d Fixture and Configuration lane, and its after hook added 13-17 s to its end (file wall minus test time on the last three main runs;kubernetes-compute-driver-real, which has no such hook, shows about 2 s).Change
scripts/ci/cleanup.mjs: after deleting a k3d cluster, if<directory>/storageis not empty, empty it as root from the cluster's own node image (docker run --rm --pull=never --network=none --user=0 --security-opt=label=disable --entrypoint=find ... /storage -mindepth 1 -delete). The cluster is gone by then, so no workload can write there again. The image is already present; it is never pulled. An empty storage directory starts no container. An image value that starts with-is refused.tests/helpers/kubernetes-compute-real.mjs:createNamespaceReaper()becomes a plaindeleteNamespaces(); the two compute files drop the after hook, andharness-workspace-released-k3ddrops its per-case volume wait.ci-cleanup.test.mjs: a new case leaves an unwritable volume directory in the storage and checks the exact container command, that it runs only after the cluster is deleted, and that the cluster directory is then gone. The existing k3d cleanup case gets an empty storage directory and checks that no container starts.Verification
From CI result files (before: main runs 40044177248 / 40045547653 / 40046084436 and other PR runs today; after: this PR's two runs).
kubernetes-compute-realwall minus test timeharness-workspace-released-k3dcaseci-cleanupcase fails with the originalEACCES: permission denied, unlink .../storage/pvc-1_tenant_workspace/state; running the step before the cluster is deleted fails it; dropping the empty-storage check fails the existing case.find /storage -mindepth 1 -delete(with--security-opt=label=disable) checked against the pinned k3s node image: it removes nested, hidden and unwritable entries.ci-cleanup.test.mjs20/20 on both heads.tsc --build tsconfig.json tests/tsconfig.json, eslint and prettier are clean on the touched files.Risks
--pull=nevermakes the Cleanup step fail visibly instead of pulling.