Skip to content

Commit 52d0e54

Browse files
committed
Add filesystem flush delay after tar extraction
Prevents race condition where package.json is read before fully written to disk on slower CI systems, which causes truncated JSON parse errors.
1 parent 85349f9 commit 52d0e54

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

scripts/install-npm-packages.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,10 @@ async function installPackage(packageInfo) {
612612
cwd: tempExtractDir,
613613
})
614614

615+
// Wait briefly for filesystem to flush after tar extraction.
616+
// This prevents reading truncated files on slower CI systems.
617+
await new Promise(resolve => setTimeout(resolve, 100))
618+
615619
// Find the extracted directory (GitHub archives extract to reponame-commitish/).
616620
const entries = await fs.readdir(tempExtractDir, {
617621
withFileTypes: true,

0 commit comments

Comments
 (0)