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.
This commit is contained in:
parent
a8f8a2dca0
commit
1da5a8a9f8
1 changed files with 20 additions and 10 deletions
|
@ -455,20 +455,30 @@ const generateVSCodeConfigurationTask = task.define('generate-vscode-configurati
|
|||
const extensionsDir = path.join(os.tmpdir(), 'tmpextdir');
|
||||
const appName = process.env.VSCODE_QUALITY === 'insider' ? 'Visual\\ Studio\\ Code\\ -\\ Insiders.app' : 'Visual\\ Studio\\ Code.app';
|
||||
const appPath = path.join(buildDir, `VSCode-darwin/${appName}/Contents/Resources/app/bin/code`);
|
||||
const codeProc = cp.exec(`${appPath} --export-default-configuration='${allConfigDetailsPath}' --wait --user-data-dir='${userDataDir}' --extensions-dir='${extensionsDir}'`);
|
||||
const codeProc = cp.exec(
|
||||
`${appPath} --export-default-configuration='${allConfigDetailsPath}' --wait --user-data-dir='${userDataDir}' --extensions-dir='${extensionsDir}'`,
|
||||
(err, stdout, stderr) => {
|
||||
clearTimeout(timer);
|
||||
if (err) {
|
||||
console.log(`err: ${err} ${err.message} ${err.toString()}`);
|
||||
reject(err);
|
||||
}
|
||||
|
||||
if (stdout) {
|
||||
console.log(`stdout: ${stdout}`);
|
||||
}
|
||||
|
||||
if (stderr) {
|
||||
console.log(`stderr: ${stderr}`);
|
||||
}
|
||||
|
||||
resolve();
|
||||
}
|
||||
);
|
||||
const timer = setTimeout(() => {
|
||||
codeProc.kill();
|
||||
reject(new Error('export-default-configuration process timed out'));
|
||||
}, 10 * 1000);
|
||||
|
||||
codeProc.stdout.on('data', d => console.log(d.toString()));
|
||||
codeProc.stderr.on('data', d => console.log(d.toString()));
|
||||
|
||||
codeProc.on('exit', () => {
|
||||
clearTimeout(timer);
|
||||
resolve();
|
||||
});
|
||||
}, 12 * 1000);
|
||||
|
||||
codeProc.on('error', err => {
|
||||
clearTimeout(timer);
|
||||
|
|
Loading…
Reference in a new issue