-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Datasource initialisation with JPA schema configured in deferred mode happens asynchronously #22852
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
Comments
Thanks for the report and the sample. Ignoring that the project does not compile because it uses JUnit4 and the vintage engine has been excluded, I can run the test and it passes when I removed the exclusion. Given that your example works for me, you'll have to share more details about your environment (OS, JDK). Attaching the logs of the execution (either as a file or on gist.github.com) would be helpful as well. |
Thanks for the reply. Maybe your computer is just faster than mine and you should try with a larger dataset. I've uploaded a new version with 20k rows so you can test. Here are the logs I've just had. I'm using Windows 10 Enterprise 1909 18363.900 and JDK 11.0.7+10. |
That is interesting, thanks. Spring Boot 2.3 has switched the JPA bootstrap mode to |
I have the same problem. In my case, the unit tests works fine in I also confirmed that my unit test context starts with |
The workaround provided by @snicoll has worked for me! Thanks! |
@rohitrajt I am not sure that you have the same problem, especially given that @wikisamuel has confirmed the workaround work for them. To figure it out and help you, please open a separate issue with a small sample that works with 2.3.0 and breaks with 2.3.2 (a zip or a link to a GitHub repo). Thanks! |
So that's our basic datasource init friend again. Lines 195 to 202 in ac35728
I am not entirely sure if that's a framework limitation or our (rather convoluted) arrangement. |
According to @jhoeller we shouldn't invoke the |
Relates to #14061 |
Unfortunately, we can't switch to this as I thought as we send an event in that EMF lock and that leads to a deadlock in framework . |
I've created spring-projects/spring-framework#25799 |
When upgrading from Spring Boot 2.2.9 to 2.3.0, unit tests cannot handle large datasets anymore.
When logging with a
debug
level, we seeextShutdownHook
drops tables before the end of the insertions, hence the test fails.Here is a minimal reproducible example : it works with 2.2.9, but when upgrading to 2.3.0 we can see 10k rows seems too much.
The problem still exist in the last version (2.3.2).
The text was updated successfully, but these errors were encountered: