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

Shut down datasources in tests #153

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

rPraml
Copy link
Contributor

@rPraml rPraml commented Jan 2, 2024

I noticed, that datasources are created, which aren't shut down.
This causes JUnit to wait up to 30 seconds after the last test was executed before it will kill the VM

Before this change

$ mvn test

// sometimes this error occurs:
[ERROR] Surefire is going to kill self fork JVM. The exit has elapsed 30 seconds after System.exit(0).

Tests run: 72
Total time:  46.631 s

After this change

$ mvn test

Tests run: 72
Total time:  14.866 s

This PR has only changes in test code

@rPraml
Copy link
Contributor Author

rPraml commented Jan 3, 2024

@rbygrave JFYI:
The wait is caused by H2 here. It has an OnExitDatabaseCloser shutdown hook which will wait up to 4 seconds until an open connection will be killed. Maybe it would be a good idea to add such a listener also to ebean-datasource, which shut down all datasources

@rob-bygrave rob-bygrave merged commit 773157b into ebean-orm:master Feb 7, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants