Skip to content

build: improve stability of windows jobs further #30238

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 1 commit into from
May 4, 2025
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
7 changes: 4 additions & 3 deletions scripts/windows-testing/convert-symlinks.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ async function transformDir(p) {
} else {
dereferenceFns.push(async () => {
await fs.unlink(subPath);
await fs.cp(realTarget, subPath, { recursive: true });
// Note: NodeJS `fs.cp` can have issues when sources are readonly.
await exec(`cp -R ${realTarget} ${subPath}`);
});
}
} else if (file.isDirectory()) {
Expand All @@ -86,7 +87,7 @@ async function transformDir(p) {
await Promise.all(directoriesToVisit.map((d) => transformDir(d)));
}

function exec(cmd, maxRetries = 2) {
function exec(cmd, maxRetries = 3) {
return new Promise((resolve, reject) => {
childProcess.exec(cmd, { cwd: rootDir }, (error) => {
if (error !== null) {
Expand Down Expand Up @@ -119,7 +120,7 @@ try {
// Re-link symlinks to work inside Windows.
// This is done in batches to avoid flakiness due to WSL
// See: https://github.com/microsoft/WSL/issues/8677.
const batchSize = 100;
const batchSize = 75;
for (let i = 0; i < relinkFns.length; i += batchSize) {
await Promise.all(relinkFns.slice(i, i + batchSize).map((fn) => fn()));
}
Expand Down
Loading