quarkus: NativeImageTest fails because the LauncherUtil is unable to determine the status of the running process
Describe the bug
After upgrading from Quarkus 1.12 to 1.13 not even a native image smoke test works anymore.
When Using the @NativeImageTest the test failes before the first test step is executed.
The exceptions says:
java.lang.IllegalStateException: Unable to determine the status of the running process. See the above logs for details
at io.quarkus.test.common.LauncherUtil.waitForCapturedListeningData(LauncherUtil.java:73)
This is happening (according to LauncherUtil) when the Quarkus Application is not reporting its address within 10 seconds. According to the logs the application started and I can see the address and port like that:
0.0.1 native (powered by Quarkus 1.13.6.Final) started in 0.029s. Listening on: http://0.0.0.0:43529"
Expected behavior
The tests is starting.
Actual behavior
The test is not starting but failing with the described exception.
Output of uname -a or ver
Linux 5.12.2-1-MANJARO #1 SMP PREEMPT Fri May 7 17:53:15 UTC 2021 x86_64 GNU/Linux
Output of java -version
openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.6+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.6+10, mixed mode)
Quarkus version or git rev
1.13.6
Build tool (ie. output of mvnw --version or gradlew --version)
gradle 7.0.2
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 84 (58 by maintainers)
Commits related to this issue
- Use proper wait-time for jar and docker launch modes. This was already done for native launcher, but it was mistakenly left out for these launch modes. Relates to #17767 — committed to geoand/quarkus by geoand 3 years ago
- Take configured wait time into account in @QuarkusIntegrationTest for log file check Relates to: https://github.com/quarkusio/quarkus/issues/17767#issuecomment-918269140 — committed to geoand/quarkus by geoand 3 years ago
- Use proper wait-time for jar and docker launch modes. This was already done for native launcher, but it was mistakenly left out for these launch modes. Relates to #17767 (cherry picked from commit ... — committed to gsmet/quarkus by geoand 3 years ago
- Take configured wait time into account in @QuarkusIntegrationTest for log file check Relates to: https://github.com/quarkusio/quarkus/issues/17767#issuecomment-918269140 (cherry picked from commit e... — committed to gsmet/quarkus by geoand 3 years ago
- Use proper wait-time for jar and docker launch modes. This was already done for native launcher, but it was mistakenly left out for these launch modes. Relates to #17767 (cherry picked from commit ... — committed to gsmet/quarkus by geoand 3 years ago
- Take configured wait time into account in @QuarkusIntegrationTest for log file check Relates to: https://github.com/quarkusio/quarkus/issues/17767#issuecomment-918269140 (cherry picked from commit e... — committed to gsmet/quarkus by geoand 3 years ago
This fix will likely be part of
2.2.4, hopefully to come out next week.I’m building / testing now from main.
Any chance this can end up in a maintenance release on 2.2 soon?
I figured out my problem:
As we use logback and the ELK Stack to write to logs directly to kibana we do not write any log files. Apparently the
@QuarkusIntegrationTesttriggers a lookup of the host and ports in a log file.Therefore we now write that logfile during service startup. I attached the code below. I don’t know if the filepath works for you. You may have to alter it to your needings. However we also had to fix the
quarkus.http.test-portto a fix value instead of the dynamic0value. Because we found no solution how to get the randomly chosen port during runtime and the code would otherwise just write0in the file.Here is the code:
Please do not blame me on the hackyness of this solution, its not my fault…
I personally I am not looking into it (as the application does not use standard logging - other applications I tried worked just fine), others are obiously free to check
Ah, I hadn’t seen that. I’ll need to check it out
@geoand I will try that with our current project but I think that an update to 2.0.0 will break a couple of other things. If that is the case I will try to create a small reproducer.