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

Flakey-ness in e2e tests with ng serve #4478

Closed
gkalpak opened this issue Feb 7, 2017 · 2 comments · Fixed by #4527
Closed

Flakey-ness in e2e tests with ng serve #4478

gkalpak opened this issue Feb 7, 2017 · 2 comments · Fixed by #4527

Comments

@gkalpak
Copy link
Member

gkalpak commented Feb 7, 2017

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
All

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:
1.0.0-beta.29

Mention any other details that might be useful.

In order to run e2e tests, one has to run ng serve and ng e2e in parallel. Now, because ng serve does some preprocessing before serving (webpack build), it seems that protractor may timeout before the Angular app is served. This leads to flakey-ness on CI.

We (think we) have run into this here (which is a cli-generated app), but this issue will probably affect all projects using the cli. I think @filipesilva was running into something similar recently. We have tried several things, from increasing timeouts to other hacks, but a more robust solution is necessary.

Something like this helper might be useful for users or maybe another way is more appropriate. But it sounds like something that would benefit most users and it would be nice if the cli provided an easy way out.

cc @IgorMinar

@filipesilva
Copy link
Contributor

My usual solution to this is to not use ng serve for e2e tests in CI. Instead I use a simpler static server (like lite-server), which is guaranteed to start up fast.

Something like this (in terms of npm scripts):

    "pree2e": "ng build",
    "e2e": "concurrently \"lite-server\" \"npm run protractor\" --kill-others --success first",

I recognize the convenience of not having to manage processes to run e2e tests though. Maybe as part of #4256 a new flag could be introduced that would manage this on the CLI side.

Hypothetically something like ng e2e --serve, defaulting to true.

filipesilva added a commit to filipesilva/angular-cli that referenced this issue Feb 8, 2017
Uses existing Protractor API to run it directly instead of using `npm run
e2e`.

Also adds support for the following flags: `--serve`, `--config`,
`--specs`, `--element-explorer`, `--webdriver-update`.

Fix angular#4256
Fix angular#4478

BREAKING CHANGE: `ng e2e` no longer needs `ng serve` to be running.
filipesilva added a commit to filipesilva/angular-cli that referenced this issue Feb 8, 2017
Uses existing Protractor API to run it directly instead of using `npm run
e2e`.

Also adds support for the following flags: `--serve`, `--config`,
`--specs`, `--element-explorer`, `--webdriver-update`.

Fix angular#4256
Fix angular#4478

BREAKING CHANGE: `ng e2e` no longer needs `ng serve` to be running.
filipesilva added a commit to filipesilva/angular-cli that referenced this issue Feb 8, 2017
Uses existing Protractor API to run it directly instead of using `npm run
e2e`.

Also adds support for the following flags: `--serve`, `--config`,
`--specs`, `--element-explorer`, `--webdriver-update`.

Fix angular#4256
Fix angular#4478

BREAKING CHANGE: `ng e2e` no longer needs `ng serve` to be running.
filipesilva added a commit to filipesilva/angular-cli that referenced this issue Feb 8, 2017
Uses existing Protractor API to run it directly instead of using `npm run
e2e`.

Also adds support for the following flags: `--serve`, `--config`,
`--specs`, `--element-explorer`, `--webdriver-update`.

Fix angular#4256
Fix angular#4478

BREAKING CHANGE: `ng e2e` no longer needs `ng serve` to be running.
filipesilva added a commit to filipesilva/angular-cli that referenced this issue Feb 9, 2017
Uses existing Protractor API to run it directly instead of using `npm run
e2e`.

Also adds support for the following flags: `--serve`, `--config`,
`--specs`, `--element-explorer`, `--webdriver-update`.

Fix angular#4256
Fix angular#4478

BREAKING CHANGE: `ng e2e` no longer needs `ng serve` to be running.
filipesilva added a commit to filipesilva/angular-cli that referenced this issue Feb 9, 2017
Uses existing Protractor API to run it directly instead of using `npm run
e2e`.

Also adds support for the following flags: `--serve`, `--config`,
`--specs`, `--element-explorer`, `--webdriver-update`.

Fix angular#4256
Fix angular#4478

BREAKING CHANGE: `ng e2e` no longer needs `ng serve` to be running.
hansl pushed a commit that referenced this issue Feb 9, 2017
Uses existing Protractor API to run it directly instead of using `npm run
e2e`.

Also adds support for the following flags: `--serve`, `--config`,
`--specs`, `--element-explorer`, `--webdriver-update`.

Fix #4256
Fix #4478

BREAKING CHANGE: `ng e2e` no longer needs `ng serve` to be running.
asnowwolf pushed a commit to asnowwolf/angular-cli that referenced this issue Apr 12, 2017
Uses existing Protractor API to run it directly instead of using `npm run
e2e`.

Also adds support for the following flags: `--serve`, `--config`,
`--specs`, `--element-explorer`, `--webdriver-update`.

Fix angular#4256
Fix angular#4478

BREAKING CHANGE: `ng e2e` no longer needs `ng serve` to be running.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants