-
Notifications
You must be signed in to change notification settings - Fork 61
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
@Micronauttest-annotated tests can hang indefinitely on Java 21 #1030
Comments
do you have an example app you can attach that reproduces the issue? |
hi @graemerocher - not one that can be shared at the moment unfortunately, but I'll put one together on tuesday when I'm back in the office. |
So I didn't have much joy creating a non-proprietary minimal application to cause the issue, but in experimenting I do seem to have just resolved the issue by setting
I'll see if I can attach an example that includes this next week. |
@graemerocher This project recreates the issue and seems to hang each time it's run inside the docker container mentioned above - normally around the 15th test. The tests pass if the io.micronaut:micronaut-management dependency is removed, or if micronaut.health.monitor.enabled is set as false in the yaml. the tests occasionally fail with some HealthMonitorTask-related dependency issue, such as the below. But I don't think it's a requirement for this to occur before the tests hang.
Let me know if there's anything else needed, cheers. |
We have also experienced this problem:
We found that pinning |
I have not been able to reproduce yet. You can possibly workaround in your tests by setting:
In your |
Expected Behavior
@Micronauttest tests never hang indefinitely
Actual Behaviour
When running our tests via gradle on the ubuntu-latest github runner, the testing can occassionally stop and hang indefinitely. The hanging always occurs after the following line is printed:
[Test worker] INFO io.micronaut.context.DefaultApplicationContext$RuntimeConfiguredEnvironment - Established active environments: [test]
However, the test that the hang occurs on is not consistent at all and changes each run, and sometimes the test suite will complete without incident. I estimate that approximately one in every 5 runs results in an indefinite hang condition.
It seems worth mentioning that some of the tests use Testcontainer Mongo and Redis container, although as mentioned these are not always the tests that the hang occurs on.
Steps To Reproduce
So far I have only been able to reproduce this locally by creating a docker container that approximates the github runner which has, and running it on 1 CPU (to approximate the 2vCPU that the normal github runner runs on for private repos).
As mentioned, the last command usually needs to be run several times to get the hang condition..
I took a thread dump of the longest-lived java process when the hanging state occurred:
threaddump.txt
Environment Information
Mentioned in the reproducing steps above for the docker image:
OS - ubuntu-latest( aka noble / 24.04)
JVM - 21.0.3 adopt JDK
Example Application
No response
Version
4.3.1
The text was updated successfully, but these errors were encountered: