Skip to content

Commit 1da5a8a

Browse files
committed
Fix --export-default-configuration flakiness
Seems like the process is exiting a bit before the file exists. Adding a short delay fixes it, waiting for the exec callback also fixes it for some reason. Probably caused by something external like maybe the CI macOS version was bumped.
1 parent a8f8a2d commit 1da5a8a

1 file changed

Lines changed: 21 additions & 11 deletions

File tree

build/gulpfile.vscode.js

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -455,20 +455,30 @@ const generateVSCodeConfigurationTask = task.define('generate-vscode-configurati
455455
const extensionsDir = path.join(os.tmpdir(), 'tmpextdir');
456456
const appName = process.env.VSCODE_QUALITY === 'insider' ? 'Visual\\ Studio\\ Code\\ -\\ Insiders.app' : 'Visual\\ Studio\\ Code.app';
457457
const appPath = path.join(buildDir, `VSCode-darwin/${appName}/Contents/Resources/app/bin/code`);
458-
const codeProc = cp.exec(`${appPath} --export-default-configuration='${allConfigDetailsPath}' --wait --user-data-dir='${userDataDir}' --extensions-dir='${extensionsDir}'`);
459-
458+
const codeProc = cp.exec(
459+
`${appPath} --export-default-configuration='${allConfigDetailsPath}' --wait --user-data-dir='${userDataDir}' --extensions-dir='${extensionsDir}'`,
460+
(err, stdout, stderr) => {
461+
clearTimeout(timer);
462+
if (err) {
463+
console.log(`err: ${err} ${err.message} ${err.toString()}`);
464+
reject(err);
465+
}
466+
467+
if (stdout) {
468+
console.log(`stdout: ${stdout}`);
469+
}
470+
471+
if (stderr) {
472+
console.log(`stderr: ${stderr}`);
473+
}
474+
475+
resolve();
476+
}
477+
);
460478
const timer = setTimeout(() => {
461479
codeProc.kill();
462480
reject(new Error('export-default-configuration process timed out'));
463-
}, 10 * 1000);
464-
465-
codeProc.stdout.on('data', d => console.log(d.toString()));
466-
codeProc.stderr.on('data', d => console.log(d.toString()));
467-
468-
codeProc.on('exit', () => {
469-
clearTimeout(timer);
470-
resolve();
471-
});
481+
}, 12 * 1000);
472482

473483
codeProc.on('error', err => {
474484
clearTimeout(timer);

0 commit comments

Comments
 (0)