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

@TestProfile and @TestHTTPResource don't play well with quarkus.http.test-port=0 #11688

Closed
aubelsb2 opened this issue Aug 28, 2020 · 0 comments · Fixed by #11741
Closed

@TestProfile and @TestHTTPResource don't play well with quarkus.http.test-port=0 #11688

aubelsb2 opened this issue Aug 28, 2020 · 0 comments · Fixed by #11741
Assignees
Labels
area/testing kind/bug Something isn't working
Milestone

Comments

@aubelsb2
Copy link

Describe the bug
@testprofile doesn't fully reset the environment in a way that @TestHTTPResource would work with random ports (ie set with quarkus.http.test-port=0 ). This might be a CDI issue?

Expected behavior
If you create more than 1 test which relies on @TestHTTPResource and @testprofile with random ports. I would expect each test to be able to run with a new random port and a new CDI injection for each object, and the HTTP server to be brought up correctly.

I would expect the URL to always point to the current server, and work regardless how many tests I have.

Actual behavior
After running the first test the HTTP server isn't accessible using the injected URL for the endpoint. Perhaps it's running on a different port. But I wouldn't know.

To Reproduce
Steps to reproduce the behavior:

  1. Create 2 unit test which include and use @TestHTTPResource and @QuarkusTest (see https://github.com/aubelsb2/quarkusrandomportprofiletestsissue for a minimal example)
  2. Run them both

Configuration

# Add your application.properties here, if applicable.
# https://quarkus.io/guides/config
quarkus.banner.enabled=false
%test.quarkus.http.test-port=0
%test.quarkus.http.test-ssl-port=0

Screenshots
n/a

Environment (please complete the following information):

  • Output of uname -a or ver:
    Microsoft Windows [Version 10.0.19041.450]
  • Output of java -version:
\quarkusrandomportprofiletestsissue>java --version
openjdk 11.0.7 2020-04-14
OpenJDK Runtime Environment GraalVM CE 20.1.0 (build 11.0.7+10-jvmci-20.1-b02)
OpenJDK 64-Bit Server VM GraalVM CE 20.1.0 (build 11.0.7+10-jvmci-20.1-b02, mixed mode, sharing)

  • GraalVM version (if different from Java):
    GraalVM CE 20.1.0 (build 11.0.7+10-jvmci-20.1-b02)
  • Quarkus version or git rev:
  • Build tool (ie. output of mvnw --version or gradlew --version):
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: C:\Users\arran_w\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\202.6397.94\plugins\maven\lib\maven3\bin\..
Java version: 11.0.7, vendor: GraalVM Community, runtime: C:\graalvm-ce-java11-20.1.0
Default locale: en_AU, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

Additional context

@aubelsb2 aubelsb2 added the kind/bug Something isn't working label Aug 28, 2020
@geoand geoand self-assigned this Aug 28, 2020
geoand added a commit to geoand/quarkus that referenced this issue Aug 31, 2020
geoand added a commit that referenced this issue Aug 31, 2020
Ensure that @testprofile works properly with random http port
@gsmet gsmet added this to the 1.7.2.Final milestone Sep 1, 2020
gsmet pushed a commit to gsmet/quarkus that referenced this issue Sep 1, 2020
gsmet pushed a commit to gsmet/quarkus that referenced this issue Sep 1, 2020
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