Skip to content
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

Application hangs on app.start with version 7+ #443

Open
fspinillo opened this issue Sep 24, 2019 · 9 comments
Open

Application hangs on app.start with version 7+ #443

fspinillo opened this issue Sep 24, 2019 · 9 comments

Comments

@fspinillo
Copy link

Currently in the process of evaluating bumping our Spectron version to match the Electron version of an app and am finding that when moving to version 7 app.start never completes. The current version we're on is Spectron v5 and it's worked with Electron 3, 4 and 5 without issues; spectron v6 works fine with Electron v5 as well. As soon as the version is bumped to v7 is when this issue manifests.

I've even used the bare bones example in the repo to target our distributed binary and the issue is still present. V5 and V6 successfully complete start.app, but v7 and v8 both hang.

@spChief
Copy link

spChief commented Oct 11, 2019

add option to you application params:
chromeDriverArgs: ['remote-debugging-port=' + Math.floor(Math.random() * (9999 - 9000) + 9000)],
It might look like this:

app = new Spectron.Application({
        args: [path.join(__dirname, '..', '..')],
        webdriverOptions: {
            deprecationWarnings: false,
        },
        chromeDriverArgs: ['remote-debugging-port=' + Math.floor(Math.random() * (9999 - 9000) + 9000)],
    });

@255kb
Copy link

255kb commented Oct 19, 2019

@spChief I can confirm that this works with Electron 6 + Spectron 8. It wasn't able anymore to "reach the application". Adding the remote debugging port solves it.

@HaNdTriX
Copy link

I've downgraded to spectron@5.0.0. That version works fine with electron@7.x.x. 😕

@255kb
Copy link

255kb commented Oct 21, 2019

I correct what I said, adding the remote debugging port only solved it locally, but I wasn't able to run the tests in any CI (GitHub actions, CircleCI...) since Electron 5.
However, I added ELECTRON_DISABLE_SANDBOX: 1 environment variable in the CI config (see electron/electron#16662) and now everything runs fine both locally and in the CI.

@spChief
Copy link

spChief commented Oct 22, 2019

It does not help for us, we are using dockers for CI jobs. In container this issue still exists, almost after adding port and disabling sandbox (tried env variable and arg --no-sandbox). Electron app just did not start at all (I used framebuffer and ffmpeg for capture). BUT - one of this hundreds tries I saw ONE success run. But I don't catch consistent pattern and just give up and downgrade electron to 5.*.

@255kb
Copy link

255kb commented Oct 22, 2019

@spChief maybe my problem is unrelated to this issue then :(

jbergstroem pushed a commit to jbergstroem/soundcleod that referenced this issue Oct 23, 2019
Note: Spectron is still at 5.x since we're likely hitting
this issue: electron-userland/spectron#443
jbergstroem pushed a commit to jbergstroem/soundcleod that referenced this issue Oct 23, 2019
Note: Spectron is still at 5.x since we're likely hitting
this issue: electron-userland/spectron#443
jbergstroem pushed a commit to jbergstroem/soundcleod that referenced this issue Oct 23, 2019
Note: Spectron is still at 5.x since we're likely hitting
this issue: electron-userland/spectron#443
jbergstroem pushed a commit to jbergstroem/soundcleod that referenced this issue Oct 23, 2019
Note: Spectron is still at 5.x since we're likely hitting
this issue: electron-userland/spectron#443
@dannypaz
Copy link

Wanted to add a comment because this is happening locally for myself and team too. Spectron 9 w/ Electron 7 is no beuno, even with the suggested steps above.

@fspinillo
Copy link
Author

The suggestion from @spChief is working for me.

Trying to use the default 9515 port did not work, so something must be up with the port being defined at run

roramirez added a commit to roramirez/MagicMirror that referenced this issue Jan 20, 2020
New version of Electron has enable by default sandbox
http://www.atom.pe/docs/api/sandbox-option/

There was some issues to migrate a new version of Electron for
MagicMirror. Using the new version in Travis CI was failing at this
time. The problem is because the testing runner is a Docker enviroment

The issue experimented is the same topic mentioned here:
 - electron/electron#17972
 - electron-userland/spectron#443

The fix for to all of this is to set the `--no-sandbox` mode in CI
testing https://electronjs.org/docs/all#--no-sandbox

This change use the feature to set and disable Sandbox using
by enviroment variable `ELECTRON_DISABLE_SANDBOX=1`
electron/electron#16576

This change has reference MagicMirrorOrg#1800
@yetyman
Copy link

yetyman commented Nov 5, 2020

This is happening to me as well on Electron 10.1.5 and spectron 12.0.0. the random port solution has not changed my results and my application does start correctly, the spectron promise from start() never resolves however

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants