Closed pascalgrimaud closed 3 years ago
I replaced some browser.sleep() calls with browser.wait(). Maybe thatβs the problem?
On Jan 26, 2021, at 12:05 AM, Pascal Grimaud notifications@github.com wrote:
Overview of the issue
Since this PR #13530 https://github.com/jhipster/generator-jhipster/pull/13530, the Protractor tests failed most of the time. See:
https://github.com/hipster-labs/jhipster-daily-builds/actions?query=workflow%3A%22No+Database%22 https://github.com/hipster-labs/jhipster-daily-builds/actions?query=workflow%3A%22No+Database%22 https://github.com/hipster-labs/jhipster-daily-builds/actions?query=workflow%3A%22Monolith+OAuth2%22 https://github.com/hipster-labs/jhipster-daily-builds/actions?query=workflow%3A%22Monolith+OAuth2%22 cc @mraible https://github.com/mraible https://user-images.githubusercontent.com/9156882/105811397-e1120400-5fac-11eb-8ce5-efa53c970ed8.png https://user-images.githubusercontent.com/9156882/105811402-e2dbc780-5fac-11eb-93ad-d033f7e8393e.png Motivation for or Use Case
Reproduce the error
Related issues
Suggest a Fix
JHipster Version(s)
Current master
JHipster configuration
Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System
Checking this box is mandatory (this is just to show you read everything) β You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jhipster/generator-jhipster/issues/13723, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAELZAXMFUYY22L5KZJQCDS3ZSR3ANCNFSM4WS6WR4A.
I don't know, I'm not a Protractor expert like you :) But we could give a try
I'm reopening this, as it's still flaky
I'll look into them now...
I tried some change too, but didn't fix it yet.
My workflow:
I typically re-create the failing app locally, then run:
npm run ci:e2e:package
npm run ci:e2e:prepare
npm run ci:e2e:run
If it passes locally, it's a CI issue and we need to add pauses, wait fors, etc...
Locally, it passes, I couldn't reproduce.
The first time I tried it, it didn't work.
[1] 2 passing (9s)
[1] 1 failing
[1]
[1] 1) Administration
[1] "before all" hook: ret for "should load metrics":
[1] TimeoutError: Wait timed out after 5003ms
[1] at /Users/mraible/dev/react-nodatabase-oauth2-gradle/node_modules/selenium-webdriver/lib/promise.js:2201:17
[1] at runMicrotasks (<anonymous>)
[1] at processTicksAndRejections (internal/process/task_queues.js:93:5)
I tried again, and it did pass. Can we change the e2e script to try npm run ci:e2e:run
multiple times?
I saw this recently with Protractor when running e2e tests on generated entities. It'd always pause on the edit screens. If I canceled and tried again, it'd pass on that edit screen, then pause/fail on the next one. If you canceled and restarted once for each generated entity, all tests eventually pass.
Are these running with JHI_E2E_HEADLESS=true
? That might be an option. Or use another browser, like Firefox. I just tried and it works (from protractor.conf.js
):
capabilities: {
browserName: 'firefox',
},
NOTE: I did have to run npx webdriver-manager update
after changing the browserName
value.
Here's an attempted fix: https://github.com/jhipster/generator-jhipster/pull/13754.
That's one of the reason we decided to use Cypress. Protractor is so random
Another solution would be to completely migrate to Cypress in Daily builds, and definitively abandon Protractor there
I'd be OK with that.
On Thu, Jan 28, 2021 at 16:46 Pascal Grimaud notifications@github.com wrote:
That's one of the reason we decided to use Cypress. Protractor is so random
Another solution would be to completely migrate to Cypress in Daily builds, and definitively abandon Protractor there
β You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/jhipster/generator-jhipster/issues/13723#issuecomment-769473181, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAELZANWVCXINMGOO7DNALS4HZM3ANCNFSM4WS6WR4A .
If Cypress tests prove to be flaky, we can add another implementation in Playwright. π
@mraible : for your information, I revert your PR here:
Then, I launch 5 NoDatabase builds consecutively.
So for me, there is something to do with your PR. If you're ok, we should revert it, and only add the username/password for Okta. The other codes should not changed.
I'm OK with a revert. None of these tests hit Okta and I tend to recommend Keycloak for CI anyway.
Thanks, I'll take care of it tonight, after my day work
Woah! I didn't realize you want to revert all of my changes to support Okta. It works locally, most of the time (or at least, more than before). I'm OK with it for a release, but I'd love to collaborate with you on a blog post to explain the why. :)
BTW, I'm cool if your reason is "because Okta sucks!" We can do better. We should be better than Keycloak, IMHO.
@mraible : sorry, I didn't explain well. Let me try again :-D
My branch with this commit https://github.com/pascalgrimaud/generator-jhipster/commit/0a5e996229a104baab01d37b7e4980bfe34100a8 is only here to confirm that the introduced code makes Protractor to become flaky -> this branch is only for test
I don't want to revert all the code. We should keep the username, password, and revert the other code (browser, element, etc), which seems not to be related directly to username/password
Overview of the issue
Since this PR https://github.com/jhipster/generator-jhipster/pull/13530, the Protractor tests failed most of the time. See:
cc @mraible
Motivation for or Use Case
Reproduce the error
Related issues
Suggest a Fix
JHipster Version(s)
Current master
JHipster configuration
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryBrowsers and Operating System