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

npm run e2e doesn't pass for reactive-ms JDL #18570

Closed
mraible opened this issue May 3, 2022 · 20 comments · Fixed by #18572
Closed

npm run e2e doesn't pass for reactive-ms JDL #18570

mraible opened this issue May 3, 2022 · 20 comments · Fixed by #18572
Labels
area: enhancement 🔧 $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ theme: reactive ⚛️ Spring WebFlux $300 https://www.jhipster.tech/bug-bounties/
Milestone

Comments

@mraible
Copy link
Contributor

mraible commented May 3, 2022

Overview of the issue

To prepare for my Reactive Java Microservices with JHipster talk at Spring I/O on May 26, I decided to try my demo script with the latest release.

I made it to the part where you run npm run e2e. At that point, it fails on two tests:

  • When testing /docs
  • When trying to add a new post

For Swagger, nothing renders and there's a stack trace in the console.

Screen Shot 2022-05-03 at 12 04 49

For adding a new post, it seems that the Save button is never enabled.

Post e2e test -- new Post page -- should create an instance of Post (failed)

Motivation for or Use Case

Everything worked when I wrote the post in January 2021 and when I recorded a screencast of it in May 2021.

Reproduce the error

Run jhipster jdl reactive-ms, start all the Docker containers and apps, run npm run e2e from the gateway's directory.

JHipster Version(s)

7.8.1

Browsers and Operating System
  • macOS Monterey, version 12.3.1, M1 Max
  • Chrome 100.0.4896.127
  • Node.js 16
@mraible mraible added $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ $300 https://www.jhipster.tech/bug-bounties/ labels May 3, 2022
@mshima
Copy link
Member

mshima commented May 3, 2022

I will try to reproduce.

@mshima
Copy link
Member

mshima commented May 4, 2022

The swagger problem is because the endpoint are not ready yet.

@mraible
Copy link
Contributor Author

mraible commented May 4, 2022 via email

@mshima
Copy link
Member

mshima commented May 4, 2022

Not ready to take requests.
I couldn't reproduce.

@mshima
Copy link
Member

mshima commented May 4, 2022

Just tried using chrome, it works.
Maybe it's because it's taking too long to respond, the timeout is 5s.
Are you using amd64 image on m1?

@mraible
Copy link
Contributor Author

mraible commented May 4, 2022

Yes, I am using M1 and Cypress is noticeably slower. I'd expect the app to work though, even if the Cypress test fails.

@mshima
Copy link
Member

mshima commented May 4, 2022

I tried to make swagger loaded urls dynamic but failed.
The urls needs to be loaded and parsed before creating the swagger ui.
We can increase the timeout, but the user experience will be worse IMO.

I suggest to create arm64 images.

@mraible
Copy link
Contributor Author

mraible commented May 4, 2022

I created Docker images to test things. When I tried starting everything with docker-compose up, it took a long time to start all containers. The gateway app was unreachable.

Screen Shot 2022-05-03 at 20 43 20

I stopped all containers and bumped up the available resources.

Screen Shot 2022-05-03 at 20 46 18

Then, I enabled Docker Compose V2.

Screen Shot 2022-05-03 at 20 59 36

Then, I tried docker compose up. This seemed to be much faster. Now when I run npm run e2e, all tests pass except for creating a post.

Screen Shot 2022-05-03 at 21 03 42

I can try on Intel to make sure it's not an M1 issue.

@mshima
Copy link
Member

mshima commented May 4, 2022

@mraible the linked PR should fix the post error.
I could not reproduce the swagger problem, but it should happen if the gateway takes more than 5s to respond.
The PR adds java:docker:arm64 script to build arm64 docker image.

@mraible
Copy link
Contributor Author

mraible commented May 4, 2022

The linked PR does fix the post error. The /docs test still fails with Cypress. I tried loading http://localhost:8080/admin/docs in Chrome and it takes 11 seconds. If I build Docker containers for all the apps and run them with docker compose up, the gateway isn't reachable, even though it looks like it's up in the logs.

Docker seems to indicate that amd64 images might be slow.

Screen Shot 2022-05-03 at 21 35 25

Time to try Intel!

@mraible
Copy link
Contributor Author

mraible commented May 4, 2022

I didn't realize I needed to run npm run java:docker:arm64 to build M1-compatible images. Trying that now...

@mraible
Copy link
Contributor Author

mraible commented May 4, 2022

After creating new images with the above command, I tried docker compose up and npm run e2e. Still doesn't work.

Screen Shot 2022-05-03 at 21 46 45

@mraible
Copy link
Contributor Author

mraible commented May 4, 2022

On Intel, starting the apps with ./gradlew and running npm run e2e works just fine. In fact, the Swagger UI loads in a second or so. I'm not sure why it takes so long on the M1.

@mraible
Copy link
Contributor Author

mraible commented May 4, 2022

If I build Docker containers on Intel and start with Docker Compose, the product tests fail when running npm run e2e. If I restart the store app with Docker Desktop, it works.

Screen Shot 2022-05-03 at 22 17 08

@mshima
Copy link
Member

mshima commented May 4, 2022

After creating new images with the above command, I tried docker compose up and npm run e2e. Still doesn't work.

You need to delete the amd64 images to recreate as arm64.

@mshima
Copy link
Member

mshima commented May 4, 2022

All green on m1 here.
I have Experimental Features -> Use the new Virtualization framework enabled. It provides worst disk performance, but much better processing performance.

@mraible
Copy link
Contributor Author

mraible commented May 4, 2022

I can confirm that deleting the amd64 images and turning on Experimental Features solves the problem for me.

Screen Shot 2022-05-04 at 08 59 44

@mshima
Copy link
Member

mshima commented May 4, 2022

Generating both arm64 and amd64 works for docker repository like we do at jhipster-registry.
But doesn’t for local docker.

@mshima
Copy link
Member

mshima commented Aug 15, 2022

@DanielFran
Copy link
Member

@mshima approved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: enhancement 🔧 $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ theme: reactive ⚛️ Spring WebFlux $300 https://www.jhipster.tech/bug-bounties/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants