Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanoverna committed Mar 20, 2024
1 parent 889c19a commit 2e1c6f7
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions jest-helpers/globalSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,22 @@ export default async () => {
});

await Promise.all(
shuffleArray(
siteIds.map((id) =>
queue.addPromise(async () => {
try {
await client.sites.destroy(id);
} catch (e) {
if (e instanceof ApiError && e.findError('NOT_FOUND')) {
// Other processes might have already deleted the project
return;
}

throw e;
} finally {
process.stdout.write('.');
// Different parallel processes can start deleting different files
shuffleArray(siteIds).map((id) =>
queue.addPromise(async () => {
try {
await client.sites.destroy(id);
} catch (e) {
if (e instanceof ApiError && e.findError('NOT_FOUND')) {
// Other processes might have already deleted the project
return;
}
}),
),

throw e;
} finally {
process.stdout.write('.');
}
}),
),
);
};

0 comments on commit 2e1c6f7

Please sign in to comment.