Skip to content

Commit a095db7

Browse files
committed
test(manifest): use Promise.allSettled for concurrent operations
Convert Promise.all to Promise.allSettled in patches tests to ensure all concurrent add/remove operations complete even if one fails. This provides better test error messages and prevents memory leaks.
1 parent 9b3ddbf commit a095db7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/cli/src/utils/manifest/patches.test.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ describe('patch-manifest', () => {
544544
const patches = Array.from({ length: 5 }, (_, i) => createSamplePatch(i))
545545

546546
// Add all patches concurrently
547-
await Promise.all(
547+
await Promise.allSettled(
548548
patches.map((patch, i) =>
549549
addPatch(`npm:package${i}@1.0.0`, patch, testDir),
550550
),
@@ -563,7 +563,7 @@ describe('patch-manifest', () => {
563563
await addPatch('npm:lodash@4.17.20', patch1, testDir)
564564

565565
// Run operations in parallel
566-
await Promise.all([
566+
await Promise.allSettled([
567567
addPatch('npm:express@4.17.1', patch2, testDir),
568568
addPatch('npm:minimatch@3.0.4', patch3, testDir),
569569
removePatch('npm:lodash@4.17.20', testDir),

0 commit comments

Comments
 (0)