diff --git a/dev-packages/browser-integration-tests/utils/staticAssets.ts b/dev-packages/browser-integration-tests/utils/staticAssets.ts index e293bd65237c..4b13159c58a4 100644 --- a/dev-packages/browser-integration-tests/utils/staticAssets.ts +++ b/dev-packages/browser-integration-tests/utils/staticAssets.ts @@ -27,7 +27,16 @@ export function addStaticAssetSymlink(localOutPath: string, originalPath: string // Only copy files once if (!fs.existsSync(newPath)) { - fs.symlinkSync(originalPath, newPath); + try { + fs.symlinkSync(originalPath, newPath); + } catch (error) { + // There must be some race condition here as some of our tests flakey + // because the file already exists. Let's catch and ignore + // only ignore these kind of errors + if (!`${error}`.includes('file already exists')) { + throw error; + } + } } symlinkAsset(newPath, path.join(localOutPath, fileName));