Skip to content

test(agents): consolidate cleanup timeout and revocation coverage - #139937

Merged
steipete merged 1 commit into
mainfrom
steipete/s3-compress-cleanup-tests
Sep 6, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/s3-compress-cleanup-tests

Conversation

@steipete

@steipete steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Related: #135868, #139657

What Problem This Solves

The Stage 3 cleanup-evidence suite repeated timeout setup and inspected authority callback shapes alongside tests of the actual caller boundary. This is the maintainer-requested test-debt follow-up for concern C of the #135868 split.

Why This Change Was Made

Put all seven timeout-policy cases in one table with the same before-deadline and exact-deadline assertions. Combine the revoked-restart case with the existing revoked-access/owned-cleanup case, and retain observable caller errors and successor usability instead of checking whether an internal assertion callback is a function.

User Impact

No runtime behavior changes. Test code shrinks by 97 lines (70 added / 167 deleted); production, tooling and docs each change by zero. Of that reduction, 19 lines are in the new Stage 3 CLI tests; 78 remove older policy repetition in the cleanup suite Stage 3 extended.

Evidence

All removed cases retain named coverage in the final files:

Removed repetition/assertion Remaining coverage
Default budget, trajectory override, general override, explicit-over-env precedence, explicit zero, invalid numbers, invalid formats src/agents/run-cleanup-timeout.test.ts:94, “bounds stalled cleanup with $name”, seven named table rows
Cleanup callback call-count assertions in default/trajectory cases Same table: a callback that never starts cannot produce its required timeout warning
Standalone “rejects a caller-revoked restart before closing the registered process” src/agents/cli-runner/cli-live-session-registry.test.ts:259, “fences caller-revoked live access while allowing its owned cleanup”, now includes restart rejection and no premature close
Registry callback-function introspection Same revoked-access test and src/agents/cli-runner/cli-live-session-registry.test.ts:277, “rechecks caller authority after registered process cleanup”
Plugin callback-function introspection src/agents/cli-runner/execute-plugin.test.ts:239, “does not close a successor or execute after caller revocation during restart cleanup”

The nested-uncertainty and original-result cases (run-cleanup-timeout.test.ts:218,273), distinct CLI retirement races, and real-process cleanup suites remain intact. execute-plugin.test-support.ts has two consumers, so inlining it would duplicate fixtures.

Validation: 88 focused tests passed across the three edited suites; full node scripts/check-changed.mjs exited 0, including both agent test type graphs, lint and all three dead-export scans. Independent Codex autoreview: scoped-clean through P2. git diff --check passed.

@clawsweeper

clawsweeper Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Sep 6, 2026
@steipete
steipete marked this pull request as ready for review September 6, 2026 08:27
@steipete
steipete merged commit bcecdf7 into main Sep 6, 2026
163 checks passed
@steipete
steipete deleted the steipete/s3-compress-cleanup-tests branch September 6, 2026 08:37
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant