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

Fix RestAssured URL handling and unexpected restarts in QuarkusProdModeTest #30389

Merged
merged 1 commit into from
Jan 16, 2023

Conversation

famod
Copy link
Member

@famod famod commented Jan 16, 2023

This is fixing an issue we had over at quarkiverse/quarkus-cxf#669 (comment) (cc @shumonsharif @ppalaga).

Without this fix QuarkusProdModeTest does the following when run and expectExit are enabled:

  • beforeAll:
    • start the app and wait for it to exit
    • setup RestAssured URL (RestAssuredURLManager stores the previous port)
  • beforeEach :
    • again start the app and wait for it to exit
    • again setup RestAssured URL, loosing the initially stored port to restore
  • afterAll:
    • clear the RestAssured URL, but not with the initially stored port

This fix:

  • makes sure that the app is not stared again for each test method when expectExit is enabled
  • does not even set up RestAssured URL when expectExit is enabled (App will have exited anyway)
  • make setup/clean of RestAssured URL consistent with (manual) start()/stop()

Please note that there can still be inconsistencies w.r.t. to the URL when using multiple QuarkusProdModeTests because there is only one static URL Manager, not one for each extension.

Copy link
Contributor

@geoand geoand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@Sgitario Sgitario left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@famod famod added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Jan 16, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Jan 16, 2023

✔️ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

@geoand geoand merged commit fedde83 into quarkusio:main Jan 16, 2023
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Jan 16, 2023
@quarkus-bot quarkus-bot bot added this to the 2.17 - main milestone Jan 16, 2023
@famod famod deleted the QuarkusProdModeTest branch January 16, 2023 12:02
@gsmet gsmet modified the milestones: 2.17 - main, 2.16.0.Final Jan 17, 2023
@ppalaga
Copy link
Contributor

ppalaga commented Mar 13, 2023

@gsmet could we please get this backported to 2.13?

@gsmet
Copy link
Member

gsmet commented Mar 14, 2023

I added the label and we will discuss it with @rsvoboda when we work on the next 2.13.

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

Successfully merging this pull request may close these issues.

5 participants