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

Field annotated with @TestHTTPResource is not properly set if running in native mode with random http port #12237

Closed
tisoft opened this issue Sep 21, 2020 · 3 comments · Fixed by #19002
Labels
area/testing kind/bug Something isn't working
Milestone

Comments

@tisoft
Copy link
Contributor

tisoft commented Sep 21, 2020

Describe the bug
@TestHTTPResource is not properly set if running in native mode with random http port

Expected behavior
Field annotated with @TestHTTPResource should contain the resoved port

Actual behavior
Field annotated with @TestHTTPResource contains port 0, which is the random port

To Reproduce

Link to a small reproducer (preferably a Maven project if the issue is not Gradle-specific).
https://github.com/tisoft/code-with-quarkus-issue-11891

Steps to reproduce the behavior:

  1. sdk use java 20.2.0.r11-grl
  2. ./mvnw clean verify -Pnative

Configuration

# Add your application.properties here, if applicable.
quarkus.http.test-port=0

Environment (please complete the following information):

  • Output of uname -a or ver: Linux linux-ytxx.suse 5.3.18-lp152.41-default Switch to the Maven distributed copy of the SubstrateVM annotations #1 SMP Thu Sep 3 23:02:59 UTC 2020 (a4d139b) x86_64 x86_64 x86_64 GNU/Linu
  • Output of java -version: openjdk version "11.0.8" 2020-07-14
  • GraalVM version (if different from Java): 20.2.0
  • Quarkus version or git rev: OpenJDK Runtime Environment GraalVM CE 20.2.0 (build 11.0.8+10-jvmci-20.2-b03)
  • Build tool (ie. output of mvnw --version or gradlew --version): Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)

Additional context
Releated to: #11891 (comment)

@tisoft tisoft added the kind/bug Something isn't working label Sep 21, 2020
@geoand geoand changed the title Fielad annotated with @TestHTTPResource is not properly set if running in native mode with random http port Field annotated with @TestHTTPResource is not properly set if running in native mode with random http port Sep 21, 2020
@tisoft
Copy link
Contributor Author

tisoft commented Sep 21, 2020

I could work around this in my project by not using a @TestHTTPResource annotated field, but grab the port out of RestAssured.port, which is correctly set to the captured port.

@geoand
Copy link
Contributor

geoand commented Jul 26, 2021

#19002 fixes the issue. We'll try to get it in 2.1.1.Final

stuartwdouglas added a commit that referenced this issue Jul 26, 2021
Fix usage of @TestHTTPResource with random ports in integration tests
@geoand
Copy link
Contributor

geoand commented Jul 27, 2021

Fixed in #19002

@geoand geoand closed this as completed Jul 27, 2021
@geoand geoand added this to the 2.2 - main milestone Jul 27, 2021
@gsmet gsmet modified the milestones: 2.2 - main, 2.1.1.Final Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants