Skip to content

test(agent-core-v2): retry Windows cleanup, increase slow-test timeouts - #2792

Open
jonathansampson wants to merge 2 commits into
MoonshotAI:mainfrom
jonathansampson:test/windows-docker-timeouts-and-rmdir-retry
Open

test(agent-core-v2): retry Windows cleanup, increase slow-test timeouts#2792
jonathansampson wants to merge 2 commits into
MoonshotAI:mainfrom
jonathansampson:test/windows-docker-timeouts-and-rmdir-retry

Conversation

@jonathansampson

Copy link
Copy Markdown
Contributor

Problem

Some agent-core-v2 tests are flaky or fail in Windows/Docker environments due to transient filesystem cleanup errors and timeouts that are too aggressive for slow bind-mounted filesystems or resource-constrained containers.

In particular, Windows can briefly keep files, directories, or process pipes busy after they are closed, causing recursive cleanup to fail with EBUSY, EPERM, or ENOTEMPTY. Several filesystem-heavy tests can also legitimately exceed their current timeout budgets under slower I/O or parallel load.

What changed

  • Added retry/backoff to recursive temp-directory cleanup to handle transient Windows EBUSY, EPERM, and ENOTEMPTY errors.
  • Extracted shared cleanup logic into cleanupHomeDir() where the same retry behavior was needed across multiple tests.
  • Increased timeouts for filesystem scans, manifest generation, and one subagent-spawn test to better accommodate slow bind-mounted filesystems and resource-constrained containers.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented Aug 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 43c8104

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Aug 10, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@43c8104
npx https://pkg.pr.new/@moonshot-ai/kimi-code@43c8104

commit: 43c8104

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 200dc2f079

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/agent-core-v2/test/lint/op-uniqueness.test.ts Outdated
Comment thread packages/agent-core-v2/test/lint/vendor-name-gates.test.ts Outdated
Comment thread packages/agent-core-v2/test/tool/tool.test.ts Outdated
- workspaceResources.test.ts: retry fs.rm on transient Windows EBUSY/EPERM errors after handles close.
- op-uniqueness.test.ts / vendor-name-gates.test.ts: increase timeouts for full src/ scans that can take ~9s on slow bind-mounted filesystems.
- configManifest.test.ts / wireManifest.test.ts: increase manifest-generation timeouts beyond the previous 60s budget.
- tool.test.ts: give one subagent-spawn test more headroom under parallel load in constrained containers.
- Retry recursive temp-home cleanup on transient ENOTEMPTY/EBUSY using Node's linear backoff defaults (maxRetries: 5, retryDelay: 100).
- Extract cleanupHomeDir() so four afterEach blocks share the same retrying cleanup.
@jonathansampson

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 52fff9a990

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Signed-off-by: Sampson <jjdsampson@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant