mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-09 00:05:28 +01:00
Smoke test runner fails or hangs without error (fix #141148)
This commit is contained in:
@@ -253,7 +253,7 @@ async function launchServer(options: LaunchOptions) {
|
||||
|
||||
return {
|
||||
serverProcess,
|
||||
endpoint: await measureAndLog(waitForEndpoint(serverProcess), 'waitForEndpoint(serverProcess)', logger)
|
||||
endpoint: await measureAndLog(waitForEndpoint(serverProcess, logger), 'waitForEndpoint(serverProcess)', logger)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -314,13 +314,31 @@ async function teardown(server: ChildProcess, logger: Logger): Promise<void> {
|
||||
logger.log(`Gave up tearing down server after ${retries} attempts...`);
|
||||
}
|
||||
|
||||
function waitForEndpoint(server: ChildProcess): Promise<string> {
|
||||
function waitForEndpoint(server: ChildProcess, logger: Logger): Promise<string> {
|
||||
return new Promise<string>((resolve, reject) => {
|
||||
server.stdout?.on('data', (d: Buffer) => {
|
||||
const matches = d.toString('ascii').match(/Web UI available at (.+)/);
|
||||
let endpointFound = false;
|
||||
|
||||
server.stdout?.on('data', data => {
|
||||
if (!endpointFound) {
|
||||
logger.log(`[server] stdout: ${data}`); // log until endpoint found to diagnose issues
|
||||
}
|
||||
|
||||
const matches = data.toString('ascii').match(/Web UI available at (.+)/);
|
||||
if (matches !== null) {
|
||||
endpointFound = true;
|
||||
|
||||
resolve(matches[1]);
|
||||
}
|
||||
});
|
||||
|
||||
server.stderr?.on('data', error => {
|
||||
if (!endpointFound) {
|
||||
logger.log(`[server] stderr: ${error}`); // log until endpoint found to diagnose issues
|
||||
}
|
||||
|
||||
if (error.toString().indexOf('EADDRINUSE') !== -1) {
|
||||
reject(new Error(error));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ if (!opts.web) {
|
||||
}
|
||||
|
||||
if (!fs.existsSync(electronPath || '')) {
|
||||
fail(`Can't find VSCode at ${electronPath}.`);
|
||||
fail(`Can't find VSCode at ${electronPath}. Please run VSCode once first (scripts/code.sh, scripts\\code.bat) and try again.`);
|
||||
}
|
||||
|
||||
if (process.env.VSCODE_DEV === '1') {
|
||||
|
||||
Reference in New Issue
Block a user