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

app.start() not returning the promise #312

Open
karthik1407s opened this issue Jun 29, 2018 · 3 comments
Open

app.start() not returning the promise #312

karthik1407s opened this issue Jun 29, 2018 · 3 comments

Comments

@karthik1407s
Copy link

Hi,
when I start the application, I see that start method is not returning the promise back.

Application.prototype.start = function () {
var self = this
return self.exists()
.then(function () {console.log('start chromedriver'); return self.startChromeDriver() })
.then(function () {console.log('create client'); return self.createClient() })
.then(function () {console.log('initialize'); return self.api.initialize() })
.then(function () {console.log('timeout'); return self.client.timeouts('script', self.waitTimeout) })
.then(function () {console.log('running..?'); self.running = true })
.then(function () {console.log('finally'); return self })
}

In the above code for start method, the control is not passing the self.createClient().
@kevinsawicki what would be the reason for this.?
The electron version of our application is upgraded to 2.0. Is it causing this issue.?

Thanks in advance
Karthik

@jviotti
Copy link
Member

jviotti commented Sep 18, 2018

I hit a similar symptom, which resulted in this PR:
electron/chromedriver#29. It might not have been the same cause though.

codebytere pushed a commit to electron/chromedriver that referenced this issue Oct 21, 2018
I started hitting an issue when testing an Electron application using
Spectron where Spectron's `app.start()` promise will never resolve on a
certain Mac Mini test worker, causing my tests to timeout (see related
linked issue in the commit footer).

The problem ended up being that there was a mysterious `chromedriver`
process running on the Mac Mini, bound to port 9515 (the default port).
The following steps led to the problem:

- Spectron ran `electron-chromedriver` using the default port
- `electron-chromedriver` spawned `chromedriver` on 9515, but it
reported success even though `chromedriver` printed the following error
in the background:

```
Starting ChromeDriver 2.27 (44a803957cb27610c38f7e859016ac257959aeb5) on port 9515
Only local connections are allowed.
[0.004][SEVERE]: bind() returned an error, errno=48: Address already in use
[0.005][SEVERE]: bind() returned an error, errno=48: Address already in use
Port not available. Exiting...
```

- Spectron sent a request to `http://127.0.0.1:9515/wd/hub/status` to
check if `chromedriver` was started. The mysterious `chromedriver`
process would respond to that, so Spectron happily continued

- At some point in the future, Spectron would send more HTTP requests to
the incorrect `chromedriver` server, causing some weird behaviour, and
eventually making everything hang

As a "fix", this commit checks that `chromedriver` didn't fail to
initialize, so people can at least have a better chance to understand
what went wrong on the first place.

See: electron-userland/spectron#312
Signed-off-by: Juan Cruz Viotti <[email protected]>
@cristiammercado
Copy link

cristiammercado commented Aug 19, 2019

Hi @codebytere, any advance in this issue? I'm getting stuck with this error :(

[EDIT]
After hours of tests, I made Spectron work with the changes I commented here.

@Willyfrog
Copy link

Willyfrog commented Aug 30, 2019

isn't it weird? docs explicitly say that test will fail if you add that as a command line switch (see #19), but i also needed it to work on my mac

although it is still failing on circleci

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

4 participants