Fix ENOTEMPTY error in build-schemas.ts during directory cleanup#523
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Add maxRetries and retryDelay options to fs.rmSync() call in build-schemas.ts to handle race conditions that can occur during directory cleanup. This fixes the ENOTEMPTY error that was causing CI builds to fail. Resolves: https://github.com/objectstack-ai/spec/actions/runs/21706243682 Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add logging functionality for better traceability
Fix ENOTEMPTY error in build-schemas.ts during directory cleanup
Feb 5, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses ENOTEMPTY filesystem errors occurring in CI builds during directory cleanup by adding retry logic to the fs.rmSync() call in the schema generation script.
Changes:
- Added
maxRetries: 3andretryDelay: 100parameters tofs.rmSync()inbuild-schemas.tsto handle filesystem timing issues during recursive directory deletion
| if (fs.existsSync(OUT_DIR)) { | ||
| console.log(`Cleaning output directory: ${OUT_DIR}`); | ||
| fs.rmSync(OUT_DIR, { recursive: true, force: true }); | ||
| fs.rmSync(OUT_DIR, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 }); |
There was a problem hiding this comment.
The same ENOTEMPTY error could occur in build-docs.ts which also uses recursive directory removal. Consider applying the same retry logic to the rmSync call on line 246 of build-docs.ts for consistency and to prevent similar CI failures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI builds were failing when
build-schemas.tsattempted to clean the output directory:Changes
Added retry logic to
fs.rmSync()to handle filesystem timing issues:The
maxRetriesandretryDelayoptions handle race conditions that can occur during recursive directory deletion on some filesystems.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.