question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] how to diagnose seemingly failing electron launches

See original GitHub issue

/cc @pavelfeldman

I enabled playwright based Electron smoke tests for VSCode today but had to quickly disable that again and make it not fail the build because esp. on Windows I see cases of a VSCode launch not finishing.

To clarify: we start VSCode for almost every test on a fresh user data dir, so VSCode will start 10-20 times per run.

The glue-code is quite straightforward:

https://github.com/microsoft/vscode/blob/2ada17080cd3e351e093e5fce40d36f16db3124a/test/automation/src/playwrightElectronDriver.ts#L30-L61

const electron = await measureAndLog(playwright._electron.launch({
	executablePath: configuration.electronPath,
	args: configuration.args,
	env: configuration.env as { [key: string]: string }
}), 'playwright-electron#launch', logger);

const window = await measureAndLog(electron.firstWindow(), 'playwright-electron#firstWindow', logger);

const context = window.context();

if (tracing) {
	try {
		await measureAndLog(context.tracing.start({ screenshots: true, /* remaining options are off for perf reasons */ }), 'context.tracing.start()', logger);
	} catch (error) {
		logger.log(`Failed to start playwright tracing: ${error}`); // do not fail the build when this fails
	}
}

window.on('pageerror', async (error) => logger.log(`Playwright ERROR: page error: ${error}`));
window.on('crash', () => logger.log('Playwright ERROR: page crash'));
window.on('close', () => logger.log('Playwright: page close'));
window.on('response', async (response) => {
	if (response.status() >= 400) {
		logger.log(`Playwright ERROR: HTTP status ${response.status()} for ${response.url()}`);
	}
});

One of the very first things we do before running the tests is to check for .monaco-workbench DOM element. This is our signal that we need before we consider the window as healthy.

A lot of cases on Windows timeout on this check and we use the method:

await code.driver.page.locator('.monaco-workbench').waitFor({ timeout: 40000 })

And then we sometimes get (Windows):

  1) VSCode Smoke Tests (Electron)
       Multiroot
         "before all" hook for "shows results from all folders":
     locator.waitFor: Timeout 40000ms exceeded.
=========================== logs ===========================
waiting for selector ".monaco-workbench" to be visible
============================================================
      at Application.checkWindowReady (D:\a\_work\1\s\test\automation\src\application.ts:149:56)
      at Application._start (D:\a\_work\1\s\test\automation\src\application.ts:98:4)
      at Application.start (D:\a\_work\1\s\test\automation\src\application.ts:75:3)
      at Context.<anonymous> (src\utils.ts:92:3)

This is mainly an ask what to do next. Enable tracing? Enable more logging? Launching Electron is done by playwright now so we do not really know what happens to the process when this occurs.

Thanks!

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
pavelfeldmancommented, Apr 5, 2022

Maybe an alternative for me would be to depend on a commit that is a branch off 1.20.2 with the change to get access to the Electron process?

We don’t backport fixes like this, we keep users waiting instead. But v1.21 will cut this week.

0reactions
bpaserocommented, Apr 10, 2022

This turned out to be an issue with Electron where a IPC message on startup was not received / delivered.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rocket Lab identifies cause of Electron failure - SpaceNews
Rocket Lab has identified the cause of an Electron launch failure more than two months ago and said that the vehicle is ready...
Read more >
Electron soars to orbit on Rocket Lab's "Still Testing" flight
The first test flight of the Electron, called “It's a Test,” occurred on May 25, 2017, with the launch vehicle making it to...
Read more >
The biggest launch failures (and recoveries) of 2021 | Space
1) iSpace Hyperbola-1 rocket failure · 2) USAF hypersonic missile fails · 3) Rocket Lab Electron booster failure · 4) Astra orbital test...
Read more >
Spaceflight startup Rocket Lab will try again this month to ...
Rocket Lab's Electron rocket, to be used for the upcoming flight “Still Testing.” Image: Rocket Lab. After failing to launch last month, ...
Read more >
List of Electron launches - Wikipedia
Electron is a two-stage small-lift launch vehicle built and operated by Rocket Lab. The rocket has flown 32 times with 29 successes and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found