Repository navigation
fix: preserve backup fixture inputs after cleanup fails - #187547
Conversation
|
🦞👀 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. |
|
Codex review: needs maintainer review before merge. What this changesThis PR makes backup scratch directories belong to the state fixture so failed resource cleanup preserves fixture inputs. Example: A backup reader repeatedly refuses to close while retained-input.txt contains "retained fixture input\n".
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR repairs a concrete fixture cleanup defect, and no actionable introduced bug was found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherBackup tests create isolated state and scratch directories, run archive discovery and SQLite readers, then dispose resources before deleting their input files. flowchart TD
A[Backup test case] --> B[State fixture]
B --> C[Fixture owned scratch]
B --> D[Backup discovery reader]
D --> E[Resource cleanup]
E --> F[Retain inputs on failure]
E --> G[Remove fixture on success]
Technical reviewBest possible solution: Keep scratch under the existing state fixture’s disposal barrier and retain the teardown regression and successful-cleanup control. Do we have a high-confidence way to reproduce the issue? The source exposes the independent parent-deletion path described in the linked report, and the supplied regression exercises that teardown boundary; no code was executed during this review. Is this the best way to solve the issue? The change uses the existing scratch and state owners, preserves fixture defaults and parameterized arguments, and removes the competing deletion path without changing production behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4e846533cd2b. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceTests +122, Other +2. Total +124 across 5 files. Added test files: 0. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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 29, 2026, 5:35 AM ET / 09:35 UTC. |
|
Fixed: backup fixtures preserve their inputs when reader cleanup fails and remove owned scratch after successful disposal. |
) Keep backup scratch under the state fixture so failed reader cleanup retains its inputs and successful disposal removes the owned scratch. Fixes openclaw#187525.
Fixes #187525.
What Problem This Solves
Backup test cleanup could remove fixture inputs after a retained shared-state reader failed to close. The generic state fixture correctly refused disposal, but an independent cleanup hook recursively deleted its parent afterward.
User Impact
Backup fixtures now retain their input paths when resource cleanup fails, and ordinary successful disposal removes both the fixture and its scratch directory. This change is confined to test infrastructure; the existing backup, config-capture, and hardlink assertions remain intact.
Why This Change Was Made
Scratch now belongs to the existing state fixture through
isolateBackupScratch, so one owner decides when its inputs can be removed. The shared adapters preserve the generic fixture's options, the backup family's defaults, and arguments supplied to parameterized cases. Already-isolated family consumers keep their existing setup.The regression exercises a real backup discovery snapshot and registered read transport. It keeps close failing through the actual teardown hooks, checks retained input bytes, then restores close and verifies supported snapshot retirement before removing its test-owned cache. The oversized backup-create caller shrinks; the regression lives with the existing hardlink fixture tests.
Evidence
e3eae277, the relocated regression fails because the retained marker is missing after teardown; all original 15 hardlink cases pass. The same regression passes with this change, including recovery and ordinary scratch cleanup.The completed owning Bun job passes the new regression and all 15 prior hardlink cases. The regression takes 5.3s; the hardlink file takes 20.85s and config capture takes 13.12s. The backup-create job passes all 58 cases in 69.50s, mostly transformation time. These are measurements of the CI merge composition, not a performance comparison.
The full hosted result is tracked in CI run 40848905693. The evidence establishes the conditional fixture-cleanup defect; it does not identify an earlier deleting actor or establish a production race.