Skip to content

test: Fix flakey Playwright tests due to static assets #13199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion dev-packages/browser-integration-tests/utils/staticAssets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
Loading